EventHandler
Direct Subclass:
Indirect Subclass:
EventHandler is the base class that implements event distribution
Member Summary
Public Members | ||
public get |
listeners: EventListener[]: * |
Method Summary
Public Methods | ||
public |
addListener(callback: function(eventName: string, eventSource: EventHandler), eventName: Object | Symbol, once: bool) |
|
public |
cleanup() |
|
public |
removeListener(callback: *, eventName: undefined) |
|
public |
trigger(eventName: *, params: ...*) Send an event to listeners |
Public Members
Public Methods
public addListener(callback: function(eventName: string, eventSource: EventHandler), eventName: Object | Symbol, once: bool) source
Params:
Name | Type | Attribute | Description |
callback | function(eventName: string, eventSource: EventHandler) | often includes more parameters that are specific to the event |
|
eventName | Object | Symbol |
|
a string or Symbol indicating the event to watch, defaults to ALL_EVENTS |
once | bool |
|
If true then the listener is removed after receiving one event |
public cleanup() source
public removeListener(callback: *, eventName: undefined) source
Params:
Name | Type | Attribute | Description |
callback | * | ||
eventName | undefined |
|
public trigger(eventName: *, params: ...*) source
Send an event to listeners
Params:
Name | Type | Attribute | Description |
eventName | * | ||
params | ...* |