Action

data class Action<out A : Action>(val action: A) : Reaction<A>

Dispatch another Action. The Store processes the action after the state update.

This action is placed at the end of the dispatch queue. Other actions might be processed before it. They don't see the effects of the action yet, which might lead to unexpected behaviors. Example: If the action changes a state isActive from false to true, then an action before it in the queue would still see false, and might schedule an effect erroneously.

This can be avoided by changing the state in the current reducer run, instead of using Reaction.Action.

Reusing existing state update logic is better done by extracting the state change into a function (State) -> State, and reusing that, instead of reusing an action.

When multiple Reaction.Actions are contained in a Reduction, they are dispatched in the order of occurrence.

Constructors

Link copied to clipboard
constructor(action: A)

Properties

Link copied to clipboard
val action: A