Module When

Index

Interfaces

Functions

Functions

all(promisesOrValues: Array<any>): Promise

Return a promise that will resolve only once all the supplied promisesOrValues have resolved. The resolution value of the returned promise will be an array containing the resolution values of each of the promisesOrValues.

memberof

when

Parameters

  • promisesOrValues: Array<any>

    array of anything, may contain a mix of {@link Promise}s and values

Returns

Promise

defer(): Deferred

Creates a {promise, resolver} pair, either or both of which may be given out safely to consumers. The resolver has resolve, reject, and progress. The promise has then plus extended promise API.

Returns

Deferred

join(promises?: Promise[]): Promise

Joins multiple promises into a single returned promise.

Parameters

Returns

Promise

a promise that will fulfill when all the input promises have fulfilled, or will reject when any one of the input promises rejects.

join(promises?: Array<any>): Promise

Joins multiple promises into a single returned promise.

Parameters

  • promises?: Array<any> optional

Returns

Promise

a promise that will fulfill when all the input promises have fulfilled, or will reject when any one of the input promises rejects.

resolve(promise: Promise): Promise

Returns a resolved promise. The returned promise will be

  • fulfilled with promiseOrValue if it is a value, or
  • if promiseOrValue is a promise
    • fulfilled with promiseOrValue's value after it is fulfilled
    • rejected with promiseOrValue's reason after it is rejected

Parameters

Returns

Promise

resolve(value?: T): Promise

Parameters

  • value?: T optional

Returns

Promise