class ReduxStore<S : Any, A : RAction> : ObservableState<S>
A class implementing redux pattern backed by the Redux Kotlin library.
(js)
<init> |
Creates a Redux store with given reducer function and initial state. ReduxStore(reducer: ReducerFun<S, A>, initialState: S, vararg middlewares: Middleware<S>) ReduxStore(reducer: Reducer<S, A>, initialState: S, vararg middlewares: dynamic) |
(js)
dispatch |
Dispatches a synchronous action object. fun dispatch(action: A): Unit
Dispatches an asynchronous action function. fun dispatch(actionCreator: ActionCreator<A, S>): Unit fun dispatch(actionCreator: ActionCreator<dynamic, S>): WrapperAction |
(js)
getState |
Get current state. fun getState(): S |
(js)
subscribe |
Subscribe for the state change notifications. fun subscribe(observer: (S) -> Unit): () -> Unit |
(js)
stateFlow |
Extension property returning StateFlow for an ObservableState. val <S> ObservableState<S>.stateFlow: StateFlow<S> |