ReduxStore

open class ReduxStore<S : Any, A : RAction>(reducer: <Error class: unknown class><S, A>, initialState: S, middlewares: <Error class: unknown class><S>)

Deprecated

Use TypedReduxStore instead.

Replace with

TypedReduxStore(store)

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

Parameters

S

redux state type

A

redux action type

reducer

a reducer function

initialState

an initial state

middlewares

a list of optional Redux Kotlin middlewares

Constructors

Link copied to clipboard
constructor(reducer: <Error class: unknown class><S, A>, initialState: S, vararg middlewares: <Error class: unknown class><S>)

Creates a Redux store with given reducer function and initial state.

Functions

Link copied to clipboard
fun dispatch(action: A)

Dispatches a synchronous action object.

fun dispatch(actionCreator: ActionCreator<A, S>)

Dispatches an asynchronous action function.

Link copied to clipboard
open fun getState(): S
Link copied to clipboard
open fun subscribe(observer: (S) -> Unit): () -> Unit