Show:

Module: promises/es6

promises/es6

Extends

Methods

defer(){Object}

modules/promises/es6.js, line 32

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/es6.js, line 101

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

Name Type Description
obj *

argument to check.

Promise(){Promise}

modules/promises/es6.js, line 22

Constructs a promise object.

See:
Returns:
Promise object.

race(promises){Promise}

modules/promises/es6.js, line 89

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/rsvp.js, line 75

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

Name Type Description
reason Error

the reason for rejecting the Promise.

reject(reason){Promise}

modules/promises/es6.js, line 79

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/es6.js, line 68

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/es6.js, line 56

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.