From 53e93bf70a34ea14ca718a82bc68dec7386e081a Mon Sep 17 00:00:00 2001 From: "Remo H. Jansen" Date: Wed, 25 Nov 2015 09:40:03 +0000 Subject: [PATCH] Added Q.race method. This method was missing from the type definitions file. --- q/Q.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/q/Q.d.ts b/q/Q.d.ts index 50ee49c52a..ba30b2745a 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -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(promises: IPromise[]): Promise; + + /** + * Returns a promise for the first of an array of promises to become settled. + */ + export function race(promises: IPromise[]): Promise; /** * 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.