inState

inline fun <SubState : S> inState(noinline block: InStateBuilderBlock<SubState, S, A>.() -> Unit)

Define what happens if the store is in a certain state. "In a certain state" condition is true if state is instance of the type specified as generic function parameter.


inline fun <SubState : S> inState(noinline additionalIsInState: (SubState) -> Boolean, noinline block: InStateBuilderBlock<SubState, S, A>.() -> Unit)

Deprecated

use condition block inside inState instead

This variation allows you to specify is a mix between inferring the condition of the generic function type and additionally can specify and ADDITIONAL condition that also must be true in addition to the check that the type as specified as generic fun parameter is an instance of the current state.