Class: Reacto::Operations::Uniq

Inherits:
Object
  • Object
show all
Defined in:
lib/reacto/operations/uniq.rb

Instance Method Summary collapse

Instance Method Details

#call(tracker) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/reacto/operations/uniq.rb', line 10

def call(tracker)
  value = lambda do |v|
    unless passed[v]
      passed[v] = true
      tracker.on_value(v)
    end
  end

  Subscriptions::OperationSubscription.new(tracker, value: value)
end

#passedObject



6
7
8
# File 'lib/reacto/operations/uniq.rb', line 6

def passed
  @passed ||= {}
end