Show:

Module: promises/bluebird

promises/bluebird

Extends

Methods

defer(){Object}

modules/promises/bluebird.js, line 34

Constructs a deferred object.

This object will have the following methods:

  • resolve: resolves the contained Promise.
  • reject: rejects the contained Promise.
  • promise: returns the contained Promise object of this deferred.
Returns:
deferred object.

isPromise(obj){boolean}

modules/promises/bluebird.js, line 103

Whether the given obj argument is a Promise like object (thenable).

Name Type Description
obj *

argument to check.

Promise(){Promise}

modules/promises/bluebird.js, line 24

Constructs a promise object.

See:
Returns:
Promise object.

race(promises){Promise}

modules/promises/bluebird.js, line 91

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/bluebird.js, line 81

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/bluebird.js, line 70

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 thenable.

whenAll(promises){Promise}

modules/promises/bluebird.js, line 58

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.