reducer

protected abstract suspend fun reducer(state: State, event: Event): Pair<State, List<Effect>>(source)

Given the current state and an event, reduces the event to a new state and a list of effects.

Parameters

state

the current state.

event

the event to reduce.