Readonly[observableReadonlyhastrue if .trigger() has been called since the last .consumeValue() or
.consumeTrigger() call. Reading this does not consume the trigger.
Protected ReadonlyobservableTells you if there's an unconsumed trigger, and then consumes it. Does not return the
trigger's value, use .consumeValue() for that.
true: if a trigger has not yet been consumed.
false: if the trigger has already been consumed.Gives you the most recent triggered value if the trigger has not been consumed. In order to
distinguish void or undefined set values from the trigger being consumed, use
consumeTrigger() instead.
undefined is there is no unconsumed trigger.Clean up all listeners and any other internal state.
Listen to triggered values. Listeners receive the value directly and do not consume it.
If true, the callback will immediately be fired with whatever the last triggered value is.
The callback to fire when .trigger() is called.
A callback to remove the listener.
Removes a listener from the trigger.
true if the callback was removed. false if the callback was not removed (meaning
it was never added in the first place).
Set a new value and fire all listeners, regardless of the current value.
An observable meant for one-off commands rather than state. Same as Observable except that values are set with
.trigger(), every.trigger()call fires listeners (even when the same value is sent twice), and there is no.valueproperty. Read the value with.consumeValue()instead: every call after the first returnsundefineduntil.trigger()is called again..consumeValue()only yields the most recent trigger: earlier unread triggers are dropped. Use.listen()to receive every trigger.Example: Reading a triggered value
Example: Triggering without a value
Example: Listening to every trigger