Classes
Methods
emit(event, data)
Emit an event
Parameters:
| Name | Type | Description |
|---|---|---|
event |
string | Event name |
data |
any | Data to pass to listeners |
- Source:
off(event, callback)
Unsubscribe from an event
Parameters:
| Name | Type | Description |
|---|---|---|
event |
string | Event name |
callback |
function | Callback function (optional, if omitted remove all for event) |
- Source:
on(event, callback) → {function}
Subscribe to an event
Parameters:
| Name | Type | Description |
|---|---|---|
event |
string | Event name |
callback |
function | Callback function |
- Source:
Returns:
Unsubscribe function
- Type
- function