This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/rxjs/_esm5/internal/BehaviorSubject.js

44 lines
1.5 KiB
JavaScript

/** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { Subject } from './Subject';
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
var BehaviorSubject = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(BehaviorSubject, _super);
function BehaviorSubject(_value) {
var _this = _super.call(this) || this;
_this._value = _value;
return _this;
}
Object.defineProperty(BehaviorSubject.prototype, "value", {
get: function () {
return this.getValue();
},
enumerable: true,
configurable: true
});
BehaviorSubject.prototype._subscribe = function (subscriber) {
var subscription = _super.prototype._subscribe.call(this, subscriber);
if (subscription && !subscription.closed) {
subscriber.next(this._value);
}
return subscription;
};
BehaviorSubject.prototype.getValue = function () {
if (this.hasError) {
throw this.thrownError;
}
else if (this.closed) {
throw new ObjectUnsubscribedError();
}
else {
return this._value;
}
};
BehaviorSubject.prototype.next = function (value) {
_super.prototype.next.call(this, this._value = value);
};
return BehaviorSubject;
}(Subject));
export { BehaviorSubject };
//# sourceMappingURL=BehaviorSubject.js.map