aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/internal/observable/race.js
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-03-01 20:21:29 +0000
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-03-01 20:21:29 +0000
commit61cb1570a3410c85a4489b97c172e3a50715f36c (patch)
tree8fe4a5b77ea54bba80abc817ce2c9ef0e79e7e66 /sandbox/testAppNevena/Front/node_modules/rxjs/internal/observable/race.js
parent21a53d349788c99d2007cba91a923db982353b31 (diff)
parenta9ee9e0a500a4a15bd0b5dcaf041f827228ed309 (diff)
Merge branch 'researchML' into 'dev'
Research ml See merge request igrannonica/neuronstellar!6
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/rxjs/internal/observable/race.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/internal/observable/race.js92
1 files changed, 92 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/internal/observable/race.js b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/observable/race.js
new file mode 100644
index 00000000..550feb66
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/observable/race.js
@@ -0,0 +1,92 @@
+"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, undefined, i);
+ if (this.subscriptions) {
+ this.subscriptions.push(subscription);
+ }
+ this.add(subscription);
+ }
+ this.observables = null;
+ }
+ };
+ RaceSubscriber.prototype.notifyNext = function (_outerValue, innerValue, outerIndex) {
+ 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 \ No newline at end of file