aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-03-01 21:54:41 +0100
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-03-01 21:54:41 +0100
commit6c8128f9fd5a5d0be115806c35a21b3d683df8d6 (patch)
treef46c2f6b3b9b294ff32bd75c08ccdc9e7a8cc4ef /sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js
parent2400b84e95913665da6279114168148444b8f9ab (diff)
parent7d3640f824f46490b47bd95f1c5a16644f712068 (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into logo
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js117
1 files changed, 117 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js
new file mode 100644
index 00000000..780998b8
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/rxjs/internal/Observable.js
@@ -0,0 +1,117 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var canReportError_1 = require("./util/canReportError");
+var toSubscriber_1 = require("./util/toSubscriber");
+var observable_1 = require("./symbol/observable");
+var pipe_1 = require("./util/pipe");
+var config_1 = require("./config");
+var Observable = (function () {
+ function Observable(subscribe) {
+ this._isScalar = false;
+ if (subscribe) {
+ this._subscribe = subscribe;
+ }
+ }
+ Observable.prototype.lift = function (operator) {
+ var observable = new Observable();
+ observable.source = this;
+ observable.operator = operator;
+ return observable;
+ };
+ Observable.prototype.subscribe = function (observerOrNext, error, complete) {
+ var operator = this.operator;
+ var sink = toSubscriber_1.toSubscriber(observerOrNext, error, complete);
+ if (operator) {
+ sink.add(operator.call(sink, this.source));
+ }
+ else {
+ sink.add(this.source || (config_1.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
+ this._subscribe(sink) :
+ this._trySubscribe(sink));
+ }
+ if (config_1.config.useDeprecatedSynchronousErrorHandling) {
+ if (sink.syncErrorThrowable) {
+ sink.syncErrorThrowable = false;
+ if (sink.syncErrorThrown) {
+ throw sink.syncErrorValue;
+ }
+ }
+ }
+ return sink;
+ };
+ Observable.prototype._trySubscribe = function (sink) {
+ try {
+ return this._subscribe(sink);
+ }
+ catch (err) {
+ if (config_1.config.useDeprecatedSynchronousErrorHandling) {
+ sink.syncErrorThrown = true;
+ sink.syncErrorValue = err;
+ }
+ if (canReportError_1.canReportError(sink)) {
+ sink.error(err);
+ }
+ else {
+ console.warn(err);
+ }
+ }
+ };
+ Observable.prototype.forEach = function (next, promiseCtor) {
+ var _this = this;
+ promiseCtor = getPromiseCtor(promiseCtor);
+ return new promiseCtor(function (resolve, reject) {
+ var subscription;
+ subscription = _this.subscribe(function (value) {
+ try {
+ next(value);
+ }
+ catch (err) {
+ reject(err);
+ if (subscription) {
+ subscription.unsubscribe();
+ }
+ }
+ }, reject, resolve);
+ });
+ };
+ Observable.prototype._subscribe = function (subscriber) {
+ var source = this.source;
+ return source && source.subscribe(subscriber);
+ };
+ Observable.prototype[observable_1.observable] = function () {
+ return this;
+ };
+ Observable.prototype.pipe = function () {
+ var operations = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ operations[_i] = arguments[_i];
+ }
+ if (operations.length === 0) {
+ return this;
+ }
+ return pipe_1.pipeFromArray(operations)(this);
+ };
+ Observable.prototype.toPromise = function (promiseCtor) {
+ var _this = this;
+ promiseCtor = getPromiseCtor(promiseCtor);
+ return new promiseCtor(function (resolve, reject) {
+ var value;
+ _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
+ });
+ };
+ Observable.create = function (subscribe) {
+ return new Observable(subscribe);
+ };
+ return Observable;
+}());
+exports.Observable = Observable;
+function getPromiseCtor(promiseCtor) {
+ if (!promiseCtor) {
+ promiseCtor = config_1.config.Promise || Promise;
+ }
+ if (!promiseCtor) {
+ throw new Error('no Promise impl found');
+ }
+ return promiseCtor;
+}
+//# sourceMappingURL=Observable.js.map \ No newline at end of file