Class: Reacto::Subscriptions::OperationSubscription

Inherits:
Tracker
  • Object
show all
Extended by:
Forwardable
Includes:
Subscription
Defined in:
lib/reacto/subscriptions/operation_subscription.rb

Instance Method Summary collapse

Methods included from Subscription

#add, #add_resource, #subscribed?, #unsubscribe

Methods inherited from Tracker

#on_close, #on_error, #on_open, #on_value

Constructor Details

#initialize(subscription, open: subscription.method(:on_open), value: subscription.method(:on_value), error: subscription.method(:on_error), close: subscription.method(:on_close)) ⇒ OperationSubscription

Returns a new instance of OperationSubscription.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/reacto/subscriptions/operation_subscription.rb', line 12

def initialize(
  subscription,
  open: subscription.method(:on_open),
  value: subscription.method(:on_value),
  error: subscription.method(:on_error),
  close: subscription.method(:on_close)
)
  super(open: open, value: value, error: error, close: close)

  @wrapped = subscription
end