PATH:
usr
/
local
/
lib
/
node_modules
/
ghost-cli
/
node_modules
/
rxjs
/
internal
/
observable
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); } return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var isArray_1 = require("../util/isArray"); var fromArray_1 = require("./fromArray"); var OuterSubscriber_1 = require("../OuterSubscriber"); var subscribeToResult_1 = require("../util/subscribeToResult"); function race() { var observables = []; for (var _i = 0; _i < arguments.length; _i++) { observables[_i] = arguments[_i]; } if (observables.length === 1) { if (isArray_1.isArray(observables[0])) { observables = observables[0]; } else { return observables[0]; } } return fromArray_1.fromArray(observables, undefined).lift(new RaceOperator()); } exports.race = race; var RaceOperator = (function () { function RaceOperator() { } RaceOperator.prototype.call = function (subscriber, source) { return source.subscribe(new RaceSubscriber(subscriber)); }; return RaceOperator; }()); exports.RaceOperator = RaceOperator; var RaceSubscriber = (function (_super) { __extends(RaceSubscriber, _super); function RaceSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.hasFirst = false; _this.observables = []; _this.subscriptions = []; return _this; } RaceSubscriber.prototype._next = function (observable) { this.observables.push(observable); }; RaceSubscriber.prototype._complete = function () { var observables = this.observables; var len = observables.length; if (len === 0) { this.destination.complete(); } else { for (var i = 0; i < len && !this.hasFirst; i++) { var observable = observables[i]; var subscription = subscribeToResult_1.subscribeToResult(this, observable, observable, i); if (this.subscriptions) { this.subscriptions.push(subscription); } this.add(subscription); } this.observables = null; } }; RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { if (!this.hasFirst) { this.hasFirst = true; for (var i = 0; i < this.subscriptions.length; i++) { if (i !== outerIndex) { var subscription = this.subscriptions[i]; subscription.unsubscribe(); this.remove(subscription); } } this.subscriptions = null; } this.destination.next(innerValue); }; return RaceSubscriber; }(OuterSubscriber_1.OuterSubscriber)); exports.RaceSubscriber = RaceSubscriber; //# sourceMappingURL=race.js.map
[-] race.d.ts
[edit]
[-] using.d.ts
[edit]
[-] zip.js.map
[edit]
[-] bindNodeCallback.d.ts
[edit]
[-] concat.js
[edit]
[-] fromEventPattern.js
[edit]
[-] combineLatest.js
[edit]
[-] using.js
[edit]
[-] fromArray.js.map
[edit]
[-] merge.d.ts
[edit]
[-] timer.d.ts
[edit]
[-] generate.js
[edit]
[-] generate.js.map
[edit]
[+]
dom
[+]
..
[-] defer.js
[edit]
[-] ConnectableObservable.d.ts
[edit]
[-] ConnectableObservable.js
[edit]
[-] SubscribeOnObservable.d.ts
[edit]
[-] concat.js.map
[edit]
[-] iif.d.ts
[edit]
[-] from.js.map
[edit]
[-] fromPromise.d.ts
[edit]
[-] range.js.map
[edit]
[-] partition.d.ts
[edit]
[-] generate.d.ts
[edit]
[-] interval.d.ts
[edit]
[-] merge.js.map
[edit]
[-] bindCallback.js
[edit]
[-] forkJoin.js.map
[edit]
[-] bindNodeCallback.js.map
[edit]
[-] SubscribeOnObservable.js
[edit]
[-] bindCallback.d.ts
[edit]
[-] never.d.ts
[edit]
[-] interval.js
[edit]
[-] fromPromise.js.map
[edit]
[-] empty.d.ts
[edit]
[-] of.js
[edit]
[-] ConnectableObservable.js.map
[edit]
[-] throwError.js.map
[edit]
[-] iif.js
[edit]
[-] timer.js.map
[edit]
[-] merge.js
[edit]
[-] defer.d.ts
[edit]
[-] from.d.ts
[edit]
[-] fromEventPattern.d.ts
[edit]
[-] bindCallback.js.map
[edit]
[-] range.d.ts
[edit]
[-] onErrorResumeNext.js
[edit]
[-] of.d.ts
[edit]
[-] zip.d.ts
[edit]
[-] onErrorResumeNext.js.map
[edit]
[-] partition.js
[edit]
[-] fromIterable.d.ts
[edit]
[-] never.js.map
[edit]
[-] fromPromise.js
[edit]
[-] pairs.js
[edit]
[-] timer.js
[edit]
[-] interval.js.map
[edit]
[-] zip.js
[edit]
[-] iif.js.map
[edit]
[-] fromEvent.d.ts
[edit]
[-] fromArray.js
[edit]
[-] race.js
[edit]
[-] range.js
[edit]
[-] race.js.map
[edit]
[-] forkJoin.js
[edit]
[-] bindNodeCallback.js
[edit]
[-] concat.d.ts
[edit]
[-] combineLatest.d.ts
[edit]
[-] forkJoin.d.ts
[edit]
[-] throwError.d.ts
[edit]
[-] throwError.js
[edit]
[-] fromArray.d.ts
[edit]
[-] onErrorResumeNext.d.ts
[edit]
[-] fromEvent.js
[edit]
[-] empty.js.map
[edit]
[-] defer.js.map
[edit]
[-] SubscribeOnObservable.js.map
[edit]
[-] pairs.d.ts
[edit]
[-] empty.js
[edit]
[-] pairs.js.map
[edit]
[-] fromIterable.js.map
[edit]
[-] never.js
[edit]
[-] fromEventPattern.js.map
[edit]
[-] combineLatest.js.map
[edit]
[-] partition.js.map
[edit]
[-] using.js.map
[edit]
[-] fromEvent.js.map
[edit]
[-] of.js.map
[edit]
[-] from.js
[edit]
[-] fromIterable.js
[edit]