"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); } return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var Observable_1 = require("./Observable"); var Subscriber_1 = require("./Subscriber"); var Subscription_1 = require("./Subscription"); var ObjectUnsubscribedError_1 = require("./util/ObjectUnsubscribedError"); var SubjectSubscription_1 = require("./SubjectSubscription"); var rxSubscriber_1 = require("../internal/symbol/rxSubscriber"); var SubjectSubscriber = (function (_super) { __extends(SubjectSubscriber, _super); function SubjectSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.destination = destination; return _this; } return SubjectSubscriber; }(Subscriber_1.Subscriber)); exports.SubjectSubscriber = SubjectSubscriber; var Subject = (function (_super) { __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[rxSubscriber_1.rxSubscriber] = 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_1.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_1.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_1.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_1.ObjectUnsubscribedError(); } else { return _super.prototype._trySubscribe.call(this, subscriber); } }; Subject.prototype._subscribe = function (subscriber) { if (this.closed) { throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); } else if (this.hasError) { subscriber.error(this.thrownError); return Subscription_1.Subscription.EMPTY; } else if (this.isStopped) { subscriber.complete(); return Subscription_1.Subscription.EMPTY; } else { this.observers.push(subscriber); return new SubjectSubscription_1.SubjectSubscription(this, subscriber); } }; Subject.prototype.asObservable = function () { var observable = new Observable_1.Observable(); observable.source = this; return observable; }; Subject.create = function (destination, source) { return new AnonymousSubject(destination, source); }; return Subject; }(Observable_1.Observable)); exports.Subject = Subject; var AnonymousSubject = (function (_super) { __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_1.Subscription.EMPTY; } }; return AnonymousSubject; }(Subject)); exports.AnonymousSubject = AnonymousSubject; //# sourceMappingURL=Subject.js.map
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
observable | Folder | 0755 |
|
|
operators | Folder | 0755 |
|
|
scheduled | Folder | 0755 |
|
|
scheduler | Folder | 0755 |
|
|
symbol | Folder | 0755 |
|
|
testing | Folder | 0755 |
|
|
util | Folder | 0755 |
|
|
AsyncSubject.d.ts | File | 640 B | 0644 |
|
AsyncSubject.js | File | 2.17 KB | 0644 |
|
AsyncSubject.js.map | File | 1.11 KB | 0644 |
|
BehaviorSubject.d.ts | File | 597 B | 0644 |
|
BehaviorSubject.js | File | 2.01 KB | 0644 |
|
BehaviorSubject.js.map | File | 894 B | 0644 |
|
InnerSubscriber.d.ts | File | 532 B | 0644 |
|
InnerSubscriber.js | File | 1.59 KB | 0644 |
|
InnerSubscriber.js.map | File | 801 B | 0644 |
|
Notification.d.ts | File | 3.37 KB | 0644 |
|
Notification.js | File | 2.72 KB | 0644 |
|
Notification.js.map | File | 2.09 KB | 0644 |
|
Observable.d.ts | File | 5.93 KB | 0644 |
|
Observable.js | File | 3.96 KB | 0644 |
|
Observable.js.map | File | 2.98 KB | 0644 |
|
Observer.d.ts | File | 79 B | 0644 |
|
Observer.js | File | 523 B | 0644 |
|
Observer.js.map | File | 380 B | 0644 |
|
Operator.d.ts | File | 185 B | 0644 |
|
Operator.js | File | 113 B | 0644 |
|
Operator.js.map | File | 102 B | 0644 |
|
OuterSubscriber.d.ts | File | 509 B | 0644 |
|
OuterSubscriber.js | File | 1.41 KB | 0644 |
|
OuterSubscriber.js.map | File | 543 B | 0644 |
|
ReplaySubject.d.ts | File | 982 B | 0644 |
|
ReplaySubject.js | File | 4.84 KB | 0644 |
|
ReplaySubject.js.map | File | 3.4 KB | 0644 |
|
Rx.d.ts | File | 8.91 KB | 0644 |
|
Rx.js | File | 9.22 KB | 0644 |
|
Rx.js.map | File | 2.86 KB | 0644 |
|
Scheduler.d.ts | File | 2.4 KB | 0644 |
|
Scheduler.js | File | 633 B | 0644 |
|
Scheduler.js.map | File | 537 B | 0644 |
|
Subject.d.ts | File | 2.19 KB | 0644 |
|
Subject.js | File | 5.9 KB | 0644 |
|
Subject.js.map | File | 3.82 KB | 0644 |
|
SubjectSubscription.d.ts | File | 444 B | 0644 |
|
SubjectSubscription.js | File | 1.7 KB | 0644 |
|
SubjectSubscription.js.map | File | 863 B | 0644 |
|
Subscriber.d.ts | File | 3.67 KB | 0644 |
|
Subscriber.js | File | 9.04 KB | 0644 |
|
Subscriber.js.map | File | 5.86 KB | 0644 |
|
Subscription.d.ts | File | 2.72 KB | 0644 |
|
Subscription.js | File | 5.18 KB | 0644 |
|
Subscription.js.map | File | 3.75 KB | 0644 |
|
config.d.ts | File | 860 B | 0644 |
|
config.js | File | 846 B | 0644 |
|
config.js.map | File | 502 B | 0644 |
|
innerSubscribe.d.ts | File | 2.4 KB | 0644 |
|
innerSubscribe.js | File | 4.14 KB | 0644 |
|
innerSubscribe.js.map | File | 2.15 KB | 0644 |
|
types.d.ts | File | 3.17 KB | 0644 |
|
types.js | File | 110 B | 0644 |
|
types.js.map | File | 96 B | 0644 |
|