minor adjustment to readme
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / _esm2015 / internal / BehaviorSubject.js
1 import { Subject } from './Subject';
2 import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
3 export class BehaviorSubject extends Subject {
4     constructor(_value) {
5         super();
6         this._value = _value;
7     }
8     get value() {
9         return this.getValue();
10     }
11     _subscribe(subscriber) {
12         const subscription = super._subscribe(subscriber);
13         if (subscription && !subscription.closed) {
14             subscriber.next(this._value);
15         }
16         return subscription;
17     }
18     getValue() {
19         if (this.hasError) {
20             throw this.thrownError;
21         }
22         else if (this.closed) {
23             throw new ObjectUnsubscribedError();
24         }
25         else {
26             return this._value;
27         }
28     }
29     next(value) {
30         super.next(this._value = value);
31     }
32 }
33 //# sourceMappingURL=BehaviorSubject.js.map