new Listener(listener, isOnce, context, priorityopt)
Object that handle listener function and its context.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
listener |
function | The handler function | |
isOnce |
boolean | If this listener will trigger only once, then delete itself from its dispatcher. | |
context |
Object | The context for listener execution. | |
priority |
number |
<optional> |
The priority of the listener. |
- Source:
Members
(readonly) callCount :Object
Get the call count property value.
Type:
- Object
- Source:
(readonly) listener :function
Get the listener function.
Type:
- function
- Source:
(readonly) priority :number
Get the priority number.
Type:
- number
- Source:
Methods
destroy()
Destroy method.
- Source:
detach()
Detach the listener from its event dispatcher.
- Source:
execute(dataopt, asyncopt)
Call listener passing a data object.
If listener was added using EventDispatcher.addOnce() it will be automatically removed.
If listener was added using EventDispatcher.addOnce() it will be automatically removed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
* |
<optional> |
Data that should be passed to the listener. |
async |
boolean |
<optional> |
Execute the listener in async mode (with a setTimeout at 0). |
- Source: