aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Subject.js
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
committerNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
commit6555fb80fdd8f6a5d201efadec3189d1244830a0 (patch)
treec1aa1c5aedc634ad1ea7fad4847884d559b51290 /sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Subject.js
parent7d3640f824f46490b47bd95f1c5a16644f712068 (diff)
Izbrisala bin, obj i node-modules.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Subject.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Subject.js144
1 files changed, 0 insertions, 144 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Subject.js b/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Subject.js
deleted file mode 100644
index 7bdf8153..00000000
--- a/sandbox/testAppNevena/Front/node_modules/rxjs/_esm2015/internal/Subject.js
+++ /dev/null
@@ -1,144 +0,0 @@
-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';
-export class SubjectSubscriber extends Subscriber {
- constructor(destination) {
- super(destination);
- this.destination = destination;
- }
-}
-export class Subject extends Observable {
- constructor() {
- super();
- this.observers = [];
- this.closed = false;
- this.isStopped = false;
- this.hasError = false;
- this.thrownError = null;
- }
- [rxSubscriberSymbol]() {
- return new SubjectSubscriber(this);
- }
- lift(operator) {
- const subject = new AnonymousSubject(this, this);
- subject.operator = operator;
- return subject;
- }
- next(value) {
- if (this.closed) {
- throw new ObjectUnsubscribedError();
- }
- if (!this.isStopped) {
- const { observers } = this;
- const len = observers.length;
- const copy = observers.slice();
- for (let i = 0; i < len; i++) {
- copy[i].next(value);
- }
- }
- }
- error(err) {
- if (this.closed) {
- throw new ObjectUnsubscribedError();
- }
- this.hasError = true;
- this.thrownError = err;
- this.isStopped = true;
- const { observers } = this;
- const len = observers.length;
- const copy = observers.slice();
- for (let i = 0; i < len; i++) {
- copy[i].error(err);
- }
- this.observers.length = 0;
- }
- complete() {
- if (this.closed) {
- throw new ObjectUnsubscribedError();
- }
- this.isStopped = true;
- const { observers } = this;
- const len = observers.length;
- const copy = observers.slice();
- for (let i = 0; i < len; i++) {
- copy[i].complete();
- }
- this.observers.length = 0;
- }
- unsubscribe() {
- this.isStopped = true;
- this.closed = true;
- this.observers = null;
- }
- _trySubscribe(subscriber) {
- if (this.closed) {
- throw new ObjectUnsubscribedError();
- }
- else {
- return super._trySubscribe(subscriber);
- }
- }
- _subscribe(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);
- }
- }
- asObservable() {
- const observable = new Observable();
- observable.source = this;
- return observable;
- }
-}
-Subject.create = (destination, source) => {
- return new AnonymousSubject(destination, source);
-};
-export class AnonymousSubject extends Subject {
- constructor(destination, source) {
- super();
- this.destination = destination;
- this.source = source;
- }
- next(value) {
- const { destination } = this;
- if (destination && destination.next) {
- destination.next(value);
- }
- }
- error(err) {
- const { destination } = this;
- if (destination && destination.error) {
- this.destination.error(err);
- }
- }
- complete() {
- const { destination } = this;
- if (destination && destination.complete) {
- this.destination.complete();
- }
- }
- _subscribe(subscriber) {
- const { source } = this;
- if (source) {
- return this.source.subscribe(subscriber);
- }
- else {
- return Subscription.EMPTY;
- }
- }
-}
-//# sourceMappingURL=Subject.js.map \ No newline at end of file