Show:

Module: promises/when

promises/when

when.js promises module.

See:

Extends

Methods

defer(){deferred}

modules/promises/when.js, line 30

Returns a deferred object.

note: for the sake of interoperability promise property is converted into a method.

See:
Returns:
"deferred" object.

isPromise(obj){boolean}

modules/promises/when.js, line 90

Whether the given obj argument is Promise-like object.

Name Type Description
obj *

argument to check.

See:

Promise(){Promise}

modules/promises/when.js, line 22

Constructs a promise object.

See:
Returns:
Promise object.

race(promises){Promise}

modules/promises/when.js, line 80

Returns a promise that resolves or rejects as soon as one of the promises in the iterable resolves or rejects, with the value or reason from that promise.

Name Type Description
promises Array.<Promise>

array of Promises.

reject(reason){Promise}

modules/promises/when.js, line 72

Returns a Promise object that is rejected with the given reason.

Name Type Description
reason Error

the reason for rejecting the Promise.

when(value){Promise}

modules/promises/when.js, line 62

Converts any given argument into a Promise. If that argument is a Promise it returns it.

Name Type Description
value *

value or promise to convert into a Promise.

See:

whenAll(promises){Promise}

modules/promises/when.js, line 51

Returns a Promise that is resolved once all Promises in the promises list are resolved, or rejected if one of those is rejected.

Name Type Description
promises Array

array of Promises and/or values.

See: