1 /** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { Subject } from './Subject';
4 import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
5 var BehaviorSubject = /*@__PURE__*/ (function (_super) {
6 tslib_1.__extends(BehaviorSubject, _super);
7 function BehaviorSubject(_value) {
8 var _this = _super.call(this) || this;
12 Object.defineProperty(BehaviorSubject.prototype, "value", {
14 return this.getValue();
19 BehaviorSubject.prototype._subscribe = function (subscriber) {
20 var subscription = _super.prototype._subscribe.call(this, subscriber);
21 if (subscription && !subscription.closed) {
22 subscriber.next(this._value);
26 BehaviorSubject.prototype.getValue = function () {
28 throw this.thrownError;
30 else if (this.closed) {
31 throw new ObjectUnsubscribedError();
37 BehaviorSubject.prototype.next = function (value) {
38 _super.prototype.next.call(this, this._value = value);
40 return BehaviorSubject;
42 export { BehaviorSubject };
43 //# sourceMappingURL=BehaviorSubject.js.map