createModelStore

fun createModelStore(enhancer: StoreEnhancer<ModelState>? = null, devChecks: Boolean = false, onWrite: OnWrite? = null, preloadedState: ModelState? = null, block: RoutingBuilder.() -> Unit): Store<ModelState>

Builds a Store of ModelState from a routing block. Each model's starting value comes from its RoutingBuilder.model declaration; there is no INIT-action fan-out. Dispatch routes by the exact leaf class of the action.

Parameters

enhancer

optional store enhancer (e.g. applyMiddleware), passed straight to createStore.

devChecks

when true, throws if a handler returns a new but structurally-equal model instance (a wasteful no-op write that would fire subscribers spuriously).

onWrite

optional OnWrite observer for tracing/conflict detection.

preloadedState

optional restored/persisted models overlaid onto the declared defaults at construction (its key set must be a subset of the declared models). Use to rehydrate state synchronously instead of dispatching after first render.

block

the routing configuration: model and handler registrations applied to a RoutingBuilder.