createStore

fun createStore(middlewares: Array<Middleware<Any, Any>> = emptyArray(), fn: StoreScope.() -> Unit): Store

A function used to construct a state Store instance, you can easily use StoreScope.with in the tail closure function to create a StoreRecord.

You can also use the StoreScope.named function to add a store with a specified name

val simpleStore = createStore(arrayOf(logMiddleware())) {
simpleReducer with SimpleData("default", 18)
named("todolist"){ todoReducer with persistentListOf() }
}

Return

Receiver

Parameters

fn