The function used to check equality between different values for params or value. This can
be manually set at any time to change the function used.
ProtectedinternalReadonlylastThe last resolved value. This only changes when value is set to a resolved value or when a
promise value resolves.
Do not set this directly. Use AsyncObservable.setValue instead.
ProtectedlastUsed to prevent setting different values from racing with each other.
ProtectedlastProtected ReadonlylistenerThis is necessary so we can fire listeners that listen directly to the value, not the emitted event.
The callback to call for updating value. Uses lastParams as its inputs.
ReadonlyvalueThe value which this observable currently contains. In this AsyncObservable, value may be
a promise, a resolved value, or an error.
Do not set this directly. Use AsyncObservable.setValue instead.
ProtectedwaitingProtected Static ReadonlyNotThe last params for updateCallback. This can be set by the constructor, updateTrigger,
forceUpdate, or by setParams.
Do not set this directly. Use setParams instead.
Clean up all listeners and any other internal state.
ProtecteddispatchDispatch a typed event. Causes all attached listeners listening to this event to be fired.
The number of listeners that were fired.
Force updateCallback to be called again regardless of whatever the given params are equal
to the previous params or not. value will still only be updated if the output of
updateCallback is new.
New params are optional here. If none are provided, the last set parameters are used.
Get a count of all currently attached listeners. If a listener is removed, it will no longer be counted.
Listen to changes in the observable's value.
If true, the callback will immediately be fired with whatever the current value is.
The callback to fire when a new value is set on the observable.
A callback to remove the listener.
Listen to any event omitted by the observable rather than just the value changing.
Optionaloptions: PartialWithUndefined<{}>A callback to remove the listener.
ProtectedrejectInternally updates the current value when a promise value has been rejected or an error value is given.
Remove all currently attached event listeners.
The number of listeners that were removed.
Removes a listener from the observable.
true if the callback was removed. false if the callback was not removed (meaning
it was never added in the first place).
ProtectedresolveInternally updates the current value when a promise value has been resolved or a non-promise value is given.
Updates params without triggering updates.
true if the params were updated, false otherwise.
ProtectedsetInternally sets a new promise as the current value. This is called by AsyncObservable.setValue if the given value is a promise.
Set a new value to the observable. If a promise is used, value will be set to the promise
and value will be automatically overridden with the resolution or rejection result of the
promise once it's available.
New resolved values will only be set and listeners will only be fired if it is not equal to
the current value (as determined by equalityCheck).
true if the new value was set, false otherwise.
Update the params for updateCallback. If the params are not equal to the previous params
(according to the provided or default equalityCheck), updateCallback will be called and
will update value.
true if calling this triggered an update, false otherwise.
ProtectedupdateProtectedupdate
An observable that updates its value by calling a provided callback with the provided parameters. The callback will only be triggered if the parameters change.