aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subject.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/_esm5/internal/Subject.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/_esm5/internal/Subject.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subject.js158
1 files changed, 158 insertions, 0 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subject.js b/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subject.js
new file mode 100644
index 00000000..84c3c50e
--- /dev/null
+++ b/sandbox/testAppNevena/Front/node_modules/rxjs/_esm5/internal/Subject.js
@@ -0,0 +1,158 @@
+/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */
+import * as tslib_1 from "tslib";
+import { Observable } from './Observable';
+import { Subscriber } from './Subscriber';
+import { Subscription } from './Subscription';
+import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
+import { SubjectSubscription } from './SubjectSubscription';
+import { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';
+var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
+ tslib_1.__extends(SubjectSubscriber, _super);
+ function SubjectSubscriber(destination) {
+ var _this = _super.call(this, destination) || this;
+ _this.destination = destination;
+ return _this;
+ }
+ return SubjectSubscriber;
+}(Subscriber));
+export { SubjectSubscriber };
+var Subject = /*@__PURE__*/ (function (_super) {
+ tslib_1.__extends(Subject, _super);
+ function Subject() {
+ var _this = _super.call(this) || this;
+ _this.observers = [];
+ _this.closed = false;
+ _this.isStopped = false;
+ _this.hasError = false;
+ _this.thrownError = null;
+ return _this;
+ }
+ Subject.prototype[rxSubscriberSymbol] = function () {
+ return new SubjectSubscriber(this);
+ };
+ Subject.prototype.lift = function (operator) {
+ var subject = new AnonymousSubject(this, this);
+ subject.operator = operator;
+ return subject;
+ };
+ Subject.prototype.next = function (value) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ if (!this.isStopped) {
+ var observers = this.observers;
+ var len = observers.length;
+ var copy = observers.slice();
+ for (var i = 0; i < len; i++) {
+ copy[i].next(value);
+ }
+ }
+ };
+ Subject.prototype.error = function (err) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ this.hasError = true;
+ this.thrownError = err;
+ this.isStopped = true;
+ var observers = this.observers;
+ var len = observers.length;
+ var copy = observers.slice();
+ for (var i = 0; i < len; i++) {
+ copy[i].error(err);
+ }
+ this.observers.length = 0;
+ };
+ Subject.prototype.complete = function () {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ this.isStopped = true;
+ var observers = this.observers;
+ var len = observers.length;
+ var copy = observers.slice();
+ for (var i = 0; i < len; i++) {
+ copy[i].complete();
+ }
+ this.observers.length = 0;
+ };
+ Subject.prototype.unsubscribe = function () {
+ this.isStopped = true;
+ this.closed = true;
+ this.observers = null;
+ };
+ Subject.prototype._trySubscribe = function (subscriber) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ else {
+ return _super.prototype._trySubscribe.call(this, subscriber);
+ }
+ };
+ Subject.prototype._subscribe = function (subscriber) {
+ if (this.closed) {
+ throw new ObjectUnsubscribedError();
+ }
+ else if (this.hasError) {
+ subscriber.error(this.thrownError);
+ return Subscription.EMPTY;
+ }
+ else if (this.isStopped) {
+ subscriber.complete();
+ return Subscription.EMPTY;
+ }
+ else {
+ this.observers.push(subscriber);
+ return new SubjectSubscription(this, subscriber);
+ }
+ };
+ Subject.prototype.asObservable = function () {
+ var observable = new Observable();
+ observable.source = this;
+ return observable;
+ };
+ Subject.create = function (destination, source) {
+ return new AnonymousSubject(destination, source);
+ };
+ return Subject;
+}(Observable));
+export { Subject };
+var AnonymousSubject = /*@__PURE__*/ (function (_super) {
+ tslib_1.__extends(AnonymousSubject, _super);
+ function AnonymousSubject(destination, source) {
+ var _this = _super.call(this) || this;
+ _this.destination = destination;
+ _this.source = source;
+ return _this;
+ }
+ AnonymousSubject.prototype.next = function (value) {
+ var destination = this.destination;
+ if (destination && destination.next) {
+ destination.next(value);
+ }
+ };
+ AnonymousSubject.prototype.error = function (err) {
+ var destination = this.destination;
+ if (destination && destination.error) {
+ this.destination.error(err);
+ }
+ };
+ AnonymousSubject.prototype.complete = function () {
+ var destination = this.destination;
+ if (destination && destination.complete) {
+ this.destination.complete();
+ }
+ };
+ AnonymousSubject.prototype._subscribe = function (subscriber) {
+ var source = this.source;
+ if (source) {
+ return this.source.subscribe(subscriber);
+ }
+ else {
+ return Subscription.EMPTY;
+ }
+ };
+ return AnonymousSubject;
+}(Subject));
+export { AnonymousSubject };
+//# sourceMappingURL=Subject.js.map