class ReduxStore<S : Any, A : RAction>
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
Returns the current state. |
|
fun subscribe(listener: (S) -> Unit): () -> Unit
Subscribes a client for the change state notifications. |
fun <T> Any?.createInstance(vararg args: dynamic): T
Helper function for creating JavaScript objects from dynamic constructors. |