class ReduxStore<S : Any, A : RAction> : ObservableState<S>
A class implementing redux pattern backed by the Redux Kotlin library.
ReduxStore(reducer: ReducerFun<S, A>, initialState: S, vararg middlewares: <ERROR CLASS><S>) ReduxStore(reducer: <ERROR CLASS><S, A>, initialState: S, vararg middlewares: dynamic)
Creates a Redux store with given reducer function and initial state. |
fun dispatch(action: A): Unit
Dispatches a synchronous action object. fun dispatch(actionCreator: ActionCreator<A, S>): Unit fun dispatch(actionCreator: ActionCreator<dynamic, S>): <ERROR CLASS>
Dispatches an asynchronous action function. |
|
fun getState(): S
Get current state. |
|
fun subscribe(observer: (S) -> Unit): () -> Unit
Subscribe for the state change notifications. |
fun <T> Any?.createInstance(vararg args: dynamic): T
Helper function for creating JavaScript objects from dynamic constructors. |