{"id":"9bwY","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/race.js.map","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/src/internal/observable/race.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395749058},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/package.json","includedInParent":true,"mtime":1545395355370},{"name":"tslib","loc":{"line":2,"column":25},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/race.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/tslib/tslib.es6.js"},{"name":"../util/isArray","loc":{"line":3,"column":24},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/race.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/util/isArray.js"},{"name":"./fromArray","loc":{"line":4,"column":26},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/race.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/fromArray.js"},{"name":"../OuterSubscriber","loc":{"line":5,"column":32},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/race.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/OuterSubscriber.js"},{"name":"../util/subscribeToResult","loc":{"line":6,"column":34},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/race.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/util/subscribeToResult.js"}],"generated":{"js":"\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0}),exports.race=n,exports.RaceSubscriber=exports.RaceOperator=void 0;var r=o(require(\"tslib\")),e=require(\"../util/isArray\"),t=require(\"./fromArray\"),s=require(\"../OuterSubscriber\"),i=require(\"../util/subscribeToResult\");function o(r){if(r&&r.__esModule)return r;var e={};if(null!=r)for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){var s=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(r,t):{};s.get||s.set?Object.defineProperty(e,t,s):e[t]=r[t]}return e.default=r,e}function n(){for(var r=[],s=0;s console.log(winner)\n * );\n *\n * // result:\n * // a series of 'fast one'\n * ```\n *\n * @param {...Observables} ...observables sources used to race for which Observable emits first.\n * @return {Observable} an Observable that mirrors the output of the first Observable to emit an item.\n * @static true\n * @name race\n * @owner Observable\n */\nexport function race(observables: Array>): Observable;\nexport function race(observables: Array>): Observable;\nexport function race(...observables: Array | Array>>): Observable;\nexport function race(...observables: Array | Array>>): Observable {\n // if the only argument is an array, it was most likely called with\n // `race([obs1, obs2, ...])`\n if (observables.length === 1) {\n if (isArray(observables[0])) {\n observables = >>observables[0];\n } else {\n return >observables[0];\n }\n }\n\n return fromArray(observables, undefined).lift(new RaceOperator());\n}\n\nexport class RaceOperator implements Operator {\n call(subscriber: Subscriber, source: any): TeardownLogic {\n return source.subscribe(new RaceSubscriber(subscriber));\n }\n}\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class RaceSubscriber extends OuterSubscriber {\n private hasFirst: boolean = false;\n private observables: Observable[] = [];\n private subscriptions: Subscription[] = [];\n\n constructor(destination: Subscriber) {\n super(destination);\n }\n\n protected _next(observable: any): void {\n this.observables.push(observable);\n }\n\n protected _complete() {\n const observables = this.observables;\n const len = observables.length;\n\n if (len === 0) {\n this.destination.complete();\n } else {\n for (let i = 0; i < len && !this.hasFirst; i++) {\n let observable = observables[i];\n let subscription = subscribeToResult(this, observable, observable as any, i);\n\n if (this.subscriptions) {\n this.subscriptions.push(subscription);\n }\n this.add(subscription);\n }\n this.observables = null;\n }\n }\n\n notifyNext(outerValue: T, innerValue: T,\n outerIndex: number, innerIndex: number,\n innerSub: InnerSubscriber): void {\n if (!this.hasFirst) {\n this.hasFirst = true;\n\n for (let i = 0; i < this.subscriptions.length; i++) {\n if (i !== outerIndex) {\n let subscription = this.subscriptions[i];\n\n subscription.unsubscribe();\n this.remove(subscription);\n }\n }\n\n this.subscriptions = null;\n }\n\n this.destination.next(innerValue);\n }\n}\n"},"lineCount":null}},"hash":"4344c64b8001fe91da96799acd52edf2","cacheData":{"env":{}}}