onAction

inline fun <A : Any> onAction(noinline handler: (reads: Reads, action: A) -> WriteSet)

Registers a multi-model handler for action A. The handler reads any models via Reads and returns a WriteSet of replacements. The handler must be pure: it must not call dispatch or read the store, only compute the next models from its inputs.