EventBus

EventBus

An event bus. Not sure if we're going to need this. Haven't decided yet if we'll use the bus, or return values directly. Returning values directly precludes loading data on demand, which we might want to do.

Constructor

new EventBus()

Source:

Methods

add(eventType, listener) → {String}

Description:
  • Register a listener.

Source:
Parameters:
Name Type Description
eventType String
listener function
Returns:

an identifier that can be used later to unregister this listener

Type
String

fire(eventType, payload)

Source:
Parameters:
Name Type Description
eventType String
payload Object

remove(listenerKey)

Description:
  • Remove the listener given the string provided during registration.

Source:
Parameters:
Name Type Description
listenerKey String