Constructor Summary
| Public Constructor | ||
| public |
|
|
Method Summary
| Public Methods | ||
| public |
destroy() |
|
| public |
Emit a named event. |
|
| public |
off(name: *, f: *) Remove an event listener that was registered with either EventHandler#on or EventHandler#once. |
|
| public |
Adds a named event listener. |
|
| public |
Adds a named event listener. |
|
| public |
when(name: *): * Returns a Promise that is resolved when the event name is called. |
|
Public Constructors
public constructor() source
Public Methods
public destroy() source
public emit(name: String, args: Array) source
Emit a named event. All registered event listeners that listen to the specified name will receive the event.
public off(name: *, f: *) source
Remove an event listener that was registered with either EventHandler#on or EventHandler#once.
Params:
| Name | Type | Attribute | Description |
| name | * | ||
| f | * |
public once(name: String, f: Function) source
Adds a named event listener. The listener is removed after it has been called once.
public when(name: *): * source
Returns a Promise that is resolved when the event name is called. The Promise is immediately resolved when the event name was called in the past.
Params:
| Name | Type | Attribute | Description |
| name | * |
Return:
| * |
