ModelHandlerScope

The receiver of a RoutingBuilder.model block; registers single-model handlers for model type M.

Functions

Link copied to clipboard
inline fun <A : Any> on(noinline reducer: (model: M, action: A) -> M)

Registers a pure single-model handler for action A: given the current model and the action, return the next model instance (return the same instance to signal "no change"). Matching is by exact leaf class — a handler on A does not catch subtypes of A. The reducer must be pure: it must not call dispatch or read the store, only compute the next model from its inputs.