reduce

suspend fun <S : Any, SE : Any> SimpleSyntax<S, SE>.reduce(reducer: SimpleContext<S>.() -> S)

Reducers reduce the current state and incoming events to produce a new state.

Parameters

reducer

the lambda reducing the current state and incoming event to produce a new state