Object to allow the program to wait for an unspecified event. Call the wait method will start the the waiter. This will return a Promise that will not be fulfilled until the waiter's end method is called. Successive calls to wait will be rejected.
Methods
(static) end(value)
End wait. This will cause the original Promise to fulfil to the provided value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* | Fulfillment value. |
(static) isWaiting() → {boolean}
Test whether the waiter is waiting.
Returns:
- Type
- boolean
(static) wait() → {Promise}
Wait until the end method is called. A subsequent call to wait will reject.
Returns:
Fulfils to the value passed to the end method.
- Type
- Promise