Update<State, Msg, Effect> typedef
A pure function type that updates the state in response to a message.
State
: The type representing the feature's state.Msg
: The type representing messages that trigger state changes.Effect
: The type of side effects triggered during the update.
This function takes the current state and an incoming message, then returns a Next record containing the new state and any effects to execute.
The main idea is that this function must be pure. If it's not, you might want to look at other state managers. :)
Implementation
@experimental
typedef Update<State, Msg, Effect> = Next<State, Effect> Function(
State state,
Msg message,
);