Global

Methods

(async) allProps(promises) → {Object.<any, any>}

Like Promise.all over an object.
Parameters:
Name Type Description
promises Object.<any, Promise> An object with promises as values.
Source:
Returns:
A new object with the resolved promise values mapped to keys.
Type
Object.<any, any>

catchAs(promise, rejectValue) → {Promise.<any>}

Catch rejections and resolve to a given value.
Parameters:
Name Type Description
promise Promise The promise to operate on.
rejectValue any The value to resolve to if a rejection occurs.
Source:
Returns:
The resolved value or the reject value if rejected.
Type
Promise.<any>

delay(duration, options) → {Promise.<undefined>}

Delay for given ms.
Parameters:
Name Type Default Description
duration number 1000 The duration in ms.
options object Options. Optional.
Source:
Returns:
Resolves after delay.
Type
Promise.<undefined>

isPromise(value) → {boolean}

The isPromise method examines a value to determine if it is a Promise. Does a ducktype check. Use instanceof only an instance check is desired.
Parameters:
Name Type Description
value any The value to examine.
Source:
Returns:
True if Promise, false if not.
Type
boolean