Methods
addListener(listener, options)
Add an event listener with the specified options. If the listener has previously been added for the event, the listener's options will be updated.
Parameters:
Name | Type | Description |
---|---|---|
listener |
function | The listener to call when the event fires. |
options |
Object | Options for when the listener should be called. |
hasAnyListeners() → {boolean}
Check whether there are any listeners for the event.
Returns:
Whether there are any listeners for the event.
- Type
- boolean
hasListener(listener) → {boolean}
Check whether a particular event listener has been added.
Parameters:
Name | Type | Description |
---|---|---|
listener |
EventCallbackFunction | The listener to check. |
Returns:
Whether the listener has been added.
- Type
- boolean
notifyListeners(listenerArgumentsopt)
Notify the listeners for the event.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
listenerArguments |
Array |
<optional> |
[] | The arguments that will be passed to the listeners. |
removeListener(listener)
Remove an event listener.
Parameters:
Name | Type | Description |
---|---|---|
listener |
function | The listener to remove. |