800
801
constructor(readonly _observable: IObservable<T>, store: DisposableStore | undefined) {
802
>
const options: EmitterOptions = {
event.ts
803
>
onWillAddFirstListener: () => {
804
>
_observable.addObserver(this);
805
>
806
>
// Communicate to the observable that we received its current value and would like to be notified about future changes.
807
>
this._observable.reportChanges();
808
>
},
809
>
onDidRemoveLastListener: () => {
810
>
_observable.removeObserver(this);
811
>
}
812
>
};
813
>
if (!store) {
814
>
_addLeakageTraceLogic(options);
815
>
}
816
>
this.emitter = new Emitter<T>(options);
817
>
if (store) {
818
store.add(this.emitter);
819
}
821
822
beginUpdate<T>(_observable: IObservable<T>): void {