Command capsules a given handler function that can then be executed by its execute method.
The result of this method is then published through its ValueListenable interface
Additionally it offers other ValueListenables for it's current execution state,
if the command can be executed and for all possibly thrown exceptions during command execution.
Combined execution state of a Command represented using four of its fields.
A CommandResult will be issued for any state change of any of its fields
During normal command execution you will get this items by listening at the command's .results ValueListenable.
Sometimes you want a ValueNotifier where you can control when its
listeners are notified. With the CustomValueNotifier you can do this:
If you pass CustomNotifierMode.always for the mode parameter,
notifierListeners will be called everytime you assign a value to the
value property independent of if the value is different from the
If you pass CustomNotifierMode.manual for the mode parameter,
notifierListeners will not be called when you assign a value to the
value property. You have to call it manually to notify the Listeners.
extension functions on ValueListenable that allows you to work with them almost
as if it was a synchronous stream. Each extension function returns a new
ValueNotifier that updates its value when the value of this changes
You can chain these functions to build complex processing
pipelines from a simple ValueListenable
In the examples we use listen to react on value changes. Instead of applying listen you
could also pass the end of the function chain to a ValueListenableBuilder