184
this._changeSummary = this._changeTracker?.createChangeSummary(changeSummary);
185
}
187
>
const hadValue = this._state !== DerivedState.initial;
188
>
const oldValue = this._value;
189
>
this._state = DerivedState.upToDate;
190
>
191
>
const delayedStore = this._delayedStore;
192
>
if (delayedStore !== undefined) {
193
this._delayedStore = undefined;
194
}
196
>
if (this._store !== undefined) {
197
this._store.dispose();
198
this._store = undefined;
199
}
200
>
/** might call {@link handleChange} indirectly, which could invalidate us */
derivedImpl.ts
201
>
this._value = this._computeFn(this, changeSummary);
202
>
203
>
} finally {
204
>
this._isReaderValid = false;
205
>
// We don't want our observed observables to think that they are (not even temporarily) not being observed.
206
>
// Thus, we only unsubscribe from observables that are definitely not read anymore.
207
>
for (const o of this._dependenciesToBeRemoved) {
208
o.removeObserver(this);
209
}
211
>
212
>
if (delayedStore !== undefined) {
213
delayedStore.dispose();
214
}
216
>
217
>
didChange = this._didReportChange || (hadValue && !(this._equalityComparator(oldValue!, this._value)));
218
>
219
>
getLogger()?.handleObservableUpdated(this, {
220
>
oldValue,
221
>
newValue: this._value,
222
>
change: undefined,
223
>
didChange,
224
>
hadValue,
225
>
});
226
>
} catch (e) {
227
onBugIndicatingError(e);
228
}
230
>
this._isComputing = false;
231
>
232
>
if (!this._didReportChange && didChange) {
233
for (const r of this._observers) {
234
r.handleChange(this, undefined);
235
}
237
>
this._didReportChange = false;
238
>
}
239
>
}
240
241
public override toString(): string {