mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Adding missing race method to angular.IQService (#18476)
* Adding missing race method to angular.IQService https://docs.angularjs.org/api/ng/service/$q lists race(promises); as a valid method in AngularJS $q. Adding this type so it can be used accordingly. * Fixing lint errors * Fixing use of array
This commit is contained in:
6
types/angular/index.d.ts
vendored
6
types/angular/index.d.ts
vendored
@@ -1035,6 +1035,12 @@ declare namespace angular {
|
||||
* Creates a Deferred object which represents a task which will finish in the future.
|
||||
*/
|
||||
defer<T>(): IDeferred<T>;
|
||||
/**
|
||||
* Returns a promise that resolves or rejects as soon as one of those promises resolves or rejects, with the value or reason from that promise.
|
||||
*
|
||||
* @param promises A list or hash of promises.
|
||||
*/
|
||||
race<T>(promises: Array<IPromise<T>> | {[key: string]: IPromise<T>}): IPromise<T>;
|
||||
/**
|
||||
* Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user