aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/dist/esm/internal/Subject.js
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
commitd55b767039605256c736166a942a9138e3eacfd7 (patch)
tree947063b634c50d438a794325f13275e134aa5993 /node_modules/rxjs/dist/esm/internal/Subject.js
parent864ce67d89c77d8ef9c3361f80d619853abcf91c (diff)
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/rxjs/dist/esm/internal/Subject.js')
-rw-r--r--node_modules/rxjs/dist/esm/internal/Subject.js134
1 files changed, 0 insertions, 134 deletions
diff --git a/node_modules/rxjs/dist/esm/internal/Subject.js b/node_modules/rxjs/dist/esm/internal/Subject.js
deleted file mode 100644
index 4295f07..0000000
--- a/node_modules/rxjs/dist/esm/internal/Subject.js
+++ /dev/null
@@ -1,134 +0,0 @@
-import { Observable } from './Observable';
-import { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';
-import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
-import { arrRemove } from './util/arrRemove';
-import { errorContext } from './util/errorContext';
-export class Subject extends Observable {
- constructor() {
- super();
- this.closed = false;
- this.currentObservers = null;
- this.observers = [];
- this.isStopped = false;
- this.hasError = false;
- this.thrownError = null;
- }
- lift(operator) {
- const subject = new AnonymousSubject(this, this);
- subject.operator = operator;
- return subject;
- }
- _throwIfClosed() {
- if (this.closed) {
- throw new ObjectUnsubscribedError();
- }
- }
- next(value) {
- errorContext(() => {
- this._throwIfClosed();
- if (!this.isStopped) {
- if (!this.currentObservers) {
- this.currentObservers = Array.from(this.observers);
- }
- for (const observer of this.currentObservers) {
- observer.next(value);
- }
- }
- });
- }
- error(err) {
- errorContext(() => {
- this._throwIfClosed();
- if (!this.isStopped) {
- this.hasError = this.isStopped = true;
- this.thrownError = err;
- const { observers } = this;
- while (observers.length) {
- observers.shift().error(err);
- }
- }
- });
- }
- complete() {
- errorContext(() => {
- this._throwIfClosed();
- if (!this.isStopped) {
- this.isStopped = true;
- const { observers } = this;
- while (observers.length) {
- observers.shift().complete();
- }
- }
- });
- }
- unsubscribe() {
- this.isStopped = this.closed = true;
- this.observers = this.currentObservers = null;
- }
- get observed() {
- var _a;
- return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
- }
- _trySubscribe(subscriber) {
- this._throwIfClosed();
- return super._trySubscribe(subscriber);
- }
- _subscribe(subscriber) {
- this._throwIfClosed();
- this._checkFinalizedStatuses(subscriber);
- return this._innerSubscribe(subscriber);
- }
- _innerSubscribe(subscriber) {
- const { hasError, isStopped, observers } = this;
- if (hasError || isStopped) {
- return EMPTY_SUBSCRIPTION;
- }
- this.currentObservers = null;
- observers.push(subscriber);
- return new Subscription(() => {
- this.currentObservers = null;
- arrRemove(observers, subscriber);
- });
- }
- _checkFinalizedStatuses(subscriber) {
- const { hasError, thrownError, isStopped } = this;
- if (hasError) {
- subscriber.error(thrownError);
- }
- else if (isStopped) {
- subscriber.complete();
- }
- }
- 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) {
- var _a, _b;
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
- }
- error(err) {
- var _a, _b;
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
- }
- complete() {
- var _a, _b;
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
- }
- _subscribe(subscriber) {
- var _a, _b;
- return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
- }
-}
-//# sourceMappingURL=Subject.js.map \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage