Store

@ExperimentalCoroutinesApi()
object Store

This is the singleton that exposes the Redux API. It is meant to serve as a convenient way of ensuring only one store is used in a project, although multiple engines can technically be instantiated.

Functions

dispatch
Link copied to clipboard
fun dispatch(action: Action)
initialize
Link copied to clipboard
fun <S : State> initialize(reducers: List<Reducer<S>>, epics: List<Epic<S>>, initialState: S, coroutineScope: CoroutineScope = MainScope(), mainDispatcher: CoroutineDispatcher = Dispatchers.Main, ioDispatcher: CoroutineDispatcher = Dispatchers.IO)
listen
Link copied to clipboard
fun <S : State> listen(action: (S) -> Unit): ReceiveChannel<S>
fun <S : State, T> listen(selector: (S) -> T, action: (T) -> Unit): ReceiveChannel<S>