class ReduxStore<S : Any, A>
A class implementing redux pattern backed by the original Redux JS library. It requires @Serializable state.
ReduxStore(reducer: <ERROR CLASS><S, A>, initialState: S, stateSerializer: KSerializer<S>, vararg middlewares: dynamic)
Creates a Redux store with given reducer function and initial state. |
val stateSerializer: KSerializer<S>
a serializer for the state type |
fun dispatch(action: A): <ERROR CLASS>
Dispatches a synchronous action object. 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. |