aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/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/_esm2015/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/_esm2015/internal/Observable.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Observable.js107
1 files changed, 107 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Observable.js b/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Observable.js
new file mode 100644
index 00000000..4904b3f5
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Observable.js
@@ -0,0 +1,107 @@
+import { canReportError } from './util/canReportError';
+import { toSubscriber } from './util/toSubscriber';
+import { observable as Symbol_observable } from './symbol/observable';
+import { pipeFromArray } from './util/pipe';
+import { config } from './config';
+export class Observable {
+ constructor(subscribe) {
+ this._isScalar = false;
+ if (subscribe) {
+ this._subscribe = subscribe;
+ }
+ }
+ lift(operator) {
+ const observable = new Observable();
+ observable.source = this;
+ observable.operator = operator;
+ return observable;
+ }
+ subscribe(observerOrNext, error, complete) {
+ const { operator } = this;
+ const sink = toSubscriber(observerOrNext, error, complete);
+ if (operator) {
+ sink.add(operator.call(sink, this.source));
+ }
+ else {
+ sink.add(this.source || (config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
+ this._subscribe(sink) :
+ this._trySubscribe(sink));
+ }
+ if (config.useDeprecatedSynchronousErrorHandling) {
+ if (sink.syncErrorThrowable) {
+ sink.syncErrorThrowable = false;
+ if (sink.syncErrorThrown) {
+ throw sink.syncErrorValue;
+ }
+ }
+ }
+ return sink;
+ }
+ _trySubscribe(sink) {
+ try {
+ return this._subscribe(sink);
+ }
+ catch (err) {
+ if (config.useDeprecatedSynchronousErrorHandling) {
+ sink.syncErrorThrown = true;
+ sink.syncErrorValue = err;
+ }
+ if (canReportError(sink)) {
+ sink.error(err);
+ }
+ else {
+ console.warn(err);
+ }
+ }
+ }
+ forEach(next, promiseCtor) {
+ promiseCtor = getPromiseCtor(promiseCtor);
+ return new promiseCtor((resolve, reject) => {
+ let subscription;
+ subscription = this.subscribe((value) => {
+ try {
+ next(value);
+ }
+ catch (err) {
+ reject(err);
+ if (subscription) {
+ subscription.unsubscribe();
+ }
+ }
+ }, reject, resolve);
+ });
+ }
+ _subscribe(subscriber) {
+ const { source } = this;
+ return source && source.subscribe(subscriber);
+ }
+ [Symbol_observable]() {
+ return this;
+ }
+ pipe(...operations) {
+ if (operations.length === 0) {
+ return this;
+ }
+ return pipeFromArray(operations)(this);
+ }
+ toPromise(promiseCtor) {
+ promiseCtor = getPromiseCtor(promiseCtor);
+ return new promiseCtor((resolve, reject) => {
+ let value;
+ this.subscribe((x) => value = x, (err) => reject(err), () => resolve(value));
+ });
+ }
+}
+Observable.create = (subscribe) => {
+ return new Observable(subscribe);
+};
+function getPromiseCtor(promiseCtor) {
+ if (!promiseCtor) {
+ promiseCtor = config.Promise || Promise;
+ }
+ if (!promiseCtor) {
+ throw new Error('no Promise impl found');
+ }
+ return promiseCtor;
+}
+//# sourceMappingURL=Observable.js.map \ No newline at end of file