new EventBox()
Coordinates callbacks to run whenever named events happen.
Methods
on(name, callback)
Register a callback function which is called every time the event is triggered.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
callback |
function |
once(name) → {Promise}
Returns a promise which is resolved the next time the event is triggered.
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
Returns:
Type | Description |
---|---|
Promise |