Sha256: 4e332974babedd95862e875e2af0e57264ef65e052339815d630c62f410ea084

Contents?: true

Size: 711 Bytes

Versions: 14

Compression:

Stored size: 711 Bytes

Contents

  /**
   * Propagates the observable sequence or Promise that reacts first.
   *
   * @example
   * var = Rx.Observable.amb(xs, ys, zs);
   * @returns {Observable} An observable sequence that surfaces any of the given sequences, whichever reacted first.
   */
  Observable.amb = function () {
    var acc = observableNever(), items = [];
    if (Array.isArray(arguments[0])) {
      items = arguments[0];
    } else {
      for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); }
    }

    function func(previous, current) {
      return previous.amb(current);
    }
    for (var i = 0, len = items.length; i < len; i++) {
      acc = func(acc, items[i]);
    }
    return acc;
  };

Version data entries

14 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/linq/observable/amb.js