Show:

Module: promises/q

promises/q

Extends

Methods

defer(){deferred}

modules/promises/q.js, line 29

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/q.js, line 89

Whether the given obj argument is a Promise.

Name Type Description
obj *

argument to check.

Promise(){Promise}

modules/promises/q.js, line 21

Constructs a promise object.

See:
Returns:
Promise object.

race(promises){Promise}

modules/promises/q.js, line 79

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/q.js, line 71

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/q.js, line 50

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/q.js, line 60

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: