kvision / pl.treksoft.kvision.redux

Package pl.treksoft.kvision.redux

Predictable state container based on Redux library.

Types

RAction

interface RAction

ReduxStore

class ReduxStore<S : Any, A : RAction> : ObservableState<S>

A class implementing redux pattern backed by the Redux Kotlin library.

Type Aliases

ActionCreator

typealias ActionCreator<A, S> = (Dispatch<A>, GetState<S>) -> Unit

Dispatch

typealias Dispatch<A> = (A) -> Unit

GetState

typealias GetState<S> = () -> S

ReducerFun

typealias ReducerFun<S, A> = (S, A) -> S

Functions

createReduxStore

fun <S : Any, A : RAction> createReduxStore(reducer: ReducerFun<S, A>, initialState: S, vararg middlewares: <ERROR CLASS><S>): ReduxStore<S, A>
fun <S : Any, A : RAction> createReduxStore(reducer: <ERROR CLASS><S, A>, initialState: S, vararg middlewares: dynamic): ReduxStore<S, A>

An inline helper function for creating Redux store.