ColdStateRepo

constructor(coroutineContext: CoroutineContext = Dispatchers.Main.immediate, lazyMutableFlow: Lazy<MutableSharedFlow<State>> = defaultLazySharedFlow())

Parameters

State

the type of KalugaState represented by this repo.

coroutineContext

the CoroutineContext used to create a coroutine scope for this state machine. Make sure that if you pass a coroutine context that has sequential execution if you do not want simultaneous state changes. The default Main dispatcher meets these criteria.

lazyMutableFlow

A Lazy of State in which to store the backing data