ProtectedcurrentThe 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.
ProtectedinternalThe duration between update intervals. This can be manually modified at any time to affect the interval for the next update.
ReadonlylastThe 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.
ProtectedlastReadonlylastThe last time a value was set.
Do not set this externally, it's simply for informational purposes.
Protected ReadonlylistenerThis is necessary so we can fire listeners that listen directly to the value, not the emitted event.
The minimum duration between updates. Any extra value sets or interval updates within this duration will be ignored.
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.
Protectedistrue if the operation should not proceed due to rate limiting, otherwise
false.
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.
Immediately stop the observable's interval.
Whether or not the interval was stopped. This will be false, for example, if the
interval was already stopped.
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.
Immediately update the observable and start the interval.
Whether or not the interval started. This will be false, for example, if the
interval is already running.
Protectedruntrue if the interval triggered an update, false otherwise.
ProtectedsetSets a timeout and runts the update once its finished.
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
A variation of CallbackObservable that automatically calls the callback to update itself at a regular interval.