Merge pull request #6941 from remojansen/patch-1

Added Q.race method.
This commit is contained in:
Masahiro Wakame
2015-12-01 21:46:51 +09:00
Vendored
+5
View File
@@ -206,6 +206,11 @@ declare module Q {
* Returns a promise that is fulfilled with an array containing the fulfillment value of each promise, or is rejected with the same rejection reason as the first promise to be rejected.
*/
export function all<T>(promises: IPromise<T>[]): Promise<T[]>;
/**
* Returns a promise for the first of an array of promises to become settled.
*/
export function race<T>(promises: IPromise<T>[]): Promise<T>;
/**
* Returns a promise that is fulfilled with an array of promise state snapshots, but only after all the original promises have settled, i.e. become either fulfilled or rejected.