StateStore

abstract class StateStore<A : Action, S : State, E : SideEffect>(coroutineScope: CoroutineScope, initialState: S, debugMode: Boolean = false, reducerFactory: ReducerFactory<A, S, E>.() -> Unit)

Store wrapper, his ownership is to persist and mutate the state starting from an action A

Parameters

coroutineScope

coroutine scope

initialState

initial state S defined on creation

reducerFactory

functional interface which creates Intent starting from an action

Constructors

Link copied to clipboard
constructor(coroutineScope: CoroutineScope, initialState: S, debugMode: Boolean = false, reducerFactory: ReducerFactory<A, S, E>.() -> Unit)

Properties

Link copied to clipboard
val sideEffectFlow: StateFlow<E?>
Link copied to clipboard
val stateFlow: StateFlow<S>

Functions

Link copied to clipboard
suspend fun dispatchAction(action: A)

Dispatch an action that trigger a Reducer