MCPcopy Index your code
hub / github.com/angular-ui/ui-router / race

Function race

test/angular/1.7/angular.js:18224–18232  ·  view source on GitHub ↗

* @ngdoc method * @name $q#race * @kind function * * @description * 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 {Array. |Object. } promises An array o

(promises)

Source from the content-addressed store, hash-verified

18222 */
18223
18224 function race(promises) {
18225 var deferred = defer();
18226
18227 forEach(promises, function(promise) {
18228 when(promise).then(deferred.resolve, deferred.reject);
18229 });
18230
18231 return deferred.promise;
18232 }
18233
18234 function $Q(resolver) {
18235 if (!isFunction(resolver)) {

Callers

nothing calls this directly

Calls 3

deferFunction · 0.70
forEachFunction · 0.70
whenFunction · 0.70

Tested by

no test coverage detected