Blame view

node_modules/bluebird/js/release/any.js 421 Bytes
aaac7fed   liuqimichale   add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  "use strict";
  module.exports = function(Promise) {
  var SomePromiseArray = Promise._SomePromiseArray;
  function any(promises) {
      var ret = new SomePromiseArray(promises);
      var promise = ret.promise();
      ret.setHowMany(1);
      ret.setUnwrap();
      ret.init();
      return promise;
  }
  
  Promise.any = function (promises) {
      return any(promises);
  };
  
  Promise.prototype.any = function () {
      return any(this);
  };
  
  };