new EventsWaiter()
Create an object that can call the callback function when all registered events are completed.
- Source:
Methods
addEvent(event) → {undefined}
Register an event.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | Event name. |
- Source:
Returns:
- Type
- undefined
completeEvent(event) → {undefined}
Mark an event as completed.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | Event name. |
- Source:
Returns:
- Type
- undefined
dontWait() → {undefined}
Stop waiting.
- Source:
Returns:
- Type
- undefined
removeEvent(event) → {undefined}
Unregister an event.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | Event name. |
- Source:
Returns:
- Type
- undefined
reset() → {undefined}
Rallback this object to the inital state.
- Source:
Returns:
- Type
- undefined
wait(callback) → {undefined}
Start waiting. Call the callback function when all events are completed.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
- Source:
Returns:
- Type
- undefined