frontend/.pnpm-store/v3/files/e8/04a0ba0f83e7f9f6b47440698e4fa3592d61a66f0d834c0a8f704894dec73c5857be4582af2771567800694ce522b0e807bb76d190800a02f11a5f204eff61

27 lines
714 B
Plaintext

import { Subject } from './Subject';
export class BehaviorSubject extends Subject {
constructor(_value) {
super();
this._value = _value;
}
get value() {
return this.getValue();
}
_subscribe(subscriber) {
const subscription = super._subscribe(subscriber);
!subscription.closed && subscriber.next(this._value);
return subscription;
}
getValue() {
const { hasError, thrownError, _value } = this;
if (hasError) {
throw thrownError;
}
this._throwIfClosed();
return _value;
}
next(value) {
super.next((this._value = value));
}
}
//# sourceMappingURL=BehaviorSubject.js.map