DispatcherImpl

event/DispatcherImpl~ DispatcherImpl

Default implementation of the Dispatcher interface.

Constructor

new DispatcherImpl()

Source:
Initializes the dispatcher.

Members

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

Source:
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.
Type:
  • Map.<string, Map.<function(*), Set.<?Object>>>

Methods

_createNewEvent(event)

Source:
Create new Map storage of listeners for the specified event.
Parameters:
Name Type Description
event string The name of the event.

_createNewListener(event, listener)

Source:
Create new Set storage of scopes for the specified event and listener.
Parameters:
Name Type Description
event string The name of the event.
listener function The event listener.

_getListenersOf(event) → {Map.<function(*), Set.<?Object>>}

Source:
Retrieves the map of event listeners to scopes they are bound to.
Parameters:
Name Type Description
event string The name of the event.
Returns:
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.
Type
Map.<function(*), Set.<?Object>>

_getScopesOf(event, listener) → {Set.<?Object>}

Source:
Retrieves the scopes in which the specified event listener should be executed for the specified event.
Parameters:
Name Type Description
event string The name of the event.
listener function The event listener.
Returns:
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.
Type
Set.<?Object>

clear()

Source:

fire()

Source:

listen()

Source:

unlisten()

Source: