Mixin to create a new object that inherits event emitter.
Dependencies:
- None
Methods
(static) addEventListener(name, fn)
Register a new event.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the event. |
fn |
function | Function to trigger on event. |
(static) emit(name, …args) → {portal.EventArg}
Event to emit.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
name |
String | Event to emit. |
|
args |
* |
<repeatable> |
Arguments of the event. |
Returns:
Return the event argument.
- Type
- portal.EventArg
(static) removeEventListener(name, fn)
Remove an event listener.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the event to remove. |
fn |
function | Function to remove from the listener. |