lib/volt/reactive/event_chain.rb
def add_object(object, &block)
    chain_listener = ChainListener.new(self, object, block)

    listeners = {}

    @main_object.listeners.keys.each do |event|
      # Create a listener for each event
      listeners[event] = setup_listener(event, chain_listener)
    end

    @event_chain[chain_listener] = listeners

    return chain_listener
  end
# We can chain our events to any other object that includes
# Events
We can chain our events to any other object that includes
Events
We can chain our events to any other object that includes Events
def add_object(object, &block)
    chain_listener = ChainListener.new(self, object, block)
    listeners = {}
    @main_object.listeners.keys.each do |event|
      listeners[event] = setup_listener(event, chain_listener)
    end
    @event_chain[chain_listener] = listeners
    return chain_listener
  end
def add_object ( object , & block ) chain_listener = ChainListener . new ( self , object , block ) listeners = { } @main_object . listeners . keys . each do | event | listeners [ event ] = setup_listener ( event , chain_listener ) end @event_chain [ chain_listener ] = listeners return chain_listener end
We can chain our events to any other object that includes
Events
We can chain our events to any other object that includes Events
# Create a listener for each event
object
block