MCPcopy
hub / github.com/Exrick/xpay / race

Function race

xpay-code/src/main/resources/static/swagger/swagger-ui.js:18883–18894  ·  view source on GitHub ↗
(answerPs)

Source from the content-addressed store, hash-verified

18881 */
18882Q.race = race;
18883function race(answerPs) {
18884 return promise(function (resolve, reject) {
18885 // Switch to this once we can assume at least ES5
18886 // answerPs.forEach(function (answerP) {
18887 // Q(answerP).then(resolve, reject);
18888 // });
18889 // Use this in the meantime
18890 for (var i = 0, len = answerPs.length; i < len; i++) {
18891 Q(answerPs[i]).then(resolve, reject);
18892 }
18893 });
18894}
18895
18896Promise.prototype.race = function () {
18897 return this.then(Q.race);

Callers

nothing calls this directly

Calls 2

promiseFunction · 0.85
QFunction · 0.70

Tested by

no test coverage detected