Classes

DispatcherImpl

Default implementation of the Dispatcher interface.

Constants

EMPTY_MAP : Map.<function(*), Set.<?Object>>

An empty immutable map of event listener to scopes, used for a mismatch in the _eventListeners map.

EMPTY_SET : Set.<?Object>

An empty immutable set of event listener scopes, used for a mismatch in the _eventListeners map.

DispatcherImpl 

Default implementation of the Dispatcher interface.

Kind: global class


new DispatcherImpl() 

Initializes the dispatcher.


dispatcherImpl._eventListeners : Map.<string, Map.<function(\*), Set.<?Object>>> 

Map of event names to a map of event listeners to a set of scopes to which the event listener should be bound when being executed due to the event.

Kind: instance property of DispatcherImpl


dispatcherImpl.clear() 

Kind: instance method of DispatcherImpl


dispatcherImpl.listen() 

Kind: instance method of DispatcherImpl


dispatcherImpl.unlisten() 

Kind: instance method of DispatcherImpl


dispatcherImpl.fire() 

Kind: instance method of DispatcherImpl


dispatcherImpl._createNewEvent(event) 

Create new Map storage of listeners for the specified event.

Kind: instance method of DispatcherImpl

Param Type Description
event string The name of the event.

dispatcherImpl._createNewListener(event, listener) 

Create new Set storage of scopes for the specified event and listener.

Kind: instance method of DispatcherImpl

Param Type Description
event string The name of the event.
listener function The event listener.

dispatcherImpl._getScopesOf(event, listener) ⇒ Set.<?Object> 

Retrieves the scopes in which the specified event listener should be executed for the specified event.

Kind: instance method of DispatcherImpl
Returns: Set.<?Object> - The scopes in which the specified listeners should be executed in case of the specified event. The returned set is an unmodifiable empty set if no listeners are registered for the event.

Param Type Description
event string The name of the event.
listener function The event listener.

dispatcherImpl._getListenersOf(event) ⇒ Map.<function(\*), Set.<?Object>> 

Retrieves the map of event listeners to scopes they are bound to.

Kind: instance method of DispatcherImpl
Returns: Map.<function(\*), Set.<?Object>> - A map of event listeners to the scopes in which they should be executed. The returned map is an unmodifiable empty map if no listeners are registered for the event.

Param Type Description
event string The name of the event.

EMPTY_MAP : Map.<function(\*), Set.<?Object>> 

An empty immutable map of event listener to scopes, used for a mismatch in the _eventListeners map.

Kind: global constant


EMPTY_SET : Set.<?Object> 

An empty immutable set of event listener scopes, used for a mismatch in the _eventListeners map.

Kind: global constant