Package-level declarations

Types

Link copied to clipboard
abstract class BaseColdStateRepo<State : KalugaState, F : MutableSharedFlow<State>>(context: CoroutineContext = Dispatchers.Main.immediate) : StateRepo<State, F>

A Cold StateRepo, using a MutableSharedFlow as it's backing implementation.

Link copied to clipboard
abstract class BaseHotStateRepo<State : KalugaState, F : MutableSharedFlow<State>>(coroutineContext: CoroutineContext = Dispatchers.Main.immediate) : StateRepo<State, F>

A Hot StateRepo, using a MutableSharedFlow as it's backing implementation.

Link copied to clipboard
open class ColdStateFlowRepo<State : KalugaState>(coroutineContext: CoroutineContext = Dispatchers.Main.immediate, val initChangeStateWithRepo: suspend (State, ColdStateFlowRepo<State>) -> suspend () -> State, val deinitChangeStateWithRepo: suspend (State, ColdStateFlowRepo<State>) -> suspend () -> State?, val firstState: () -> State) : BaseColdStateRepo<State, MutableStateFlow<State>> , StateFlowRepo<State>

A BaseColdStateRepo based on a MutableStateFlow.

Link copied to clipboard
abstract class ColdStateRepo<State : KalugaState>(coroutineContext: CoroutineContext = Dispatchers.Main.immediate, val lazyMutableFlow: Lazy<MutableSharedFlow<State>> = defaultLazySharedFlow()) : BaseColdStateRepo<State, MutableSharedFlow<State>>

A BaseColdStateRepo that represents its State as a Cold flow. Data will only be set when the state is observed.

Link copied to clipboard

Marker interface to indicate a KalugaState should execute an action after creating a new state to transition to.

Link copied to clipboard

Marker interface to indicate a KalugaState should execute an action after it has been transitioned into a new state.

Link copied to clipboard

Marker interface to indicate a KalugaState should execute an action after replacing another state.

Link copied to clipboard

Marker interface to indicate a KalugaState should execute an action before creating a new state to transition to.

Link copied to clipboard

Marker interface to indicate a KalugaState should execute an action before replacing another state.

Link copied to clipboard
abstract class HotStateFlowRepo<State : KalugaState>(coroutineContext: CoroutineContext = Dispatchers.Main.immediate, val initialState: (HotStateFlowRepo<State>) -> State) : BaseHotStateRepo<State, MutableStateFlow<State>> , StateFlowRepo<State>

An abstract BaseHotStateRepo that uses a MutableStateFlow to back up its data.

Link copied to clipboard
abstract class HotStateRepo<State : KalugaState>(coroutineContext: CoroutineContext = Dispatchers.Main.immediate) : BaseHotStateRepo<State, MutableSharedFlow<State>>

An abstract BaseHotStateRepo that uses a MutableSharedFlow with a replay cache of 1 and configured with BufferOverflow.DROP_OLDEST to back up data.

Link copied to clipboard
interface KalugaState

State to be represented in a state machine

Link copied to clipboard

A wrapper for a StateFlow containing a KalugaState

Link copied to clipboard
abstract class StateRepo<State : KalugaState, F : MutableSharedFlow<State>>(coroutineContext: CoroutineContext = Dispatchers.Main.immediate) : CoroutineScope, Flow<State>

The state repo can change holds the current KalugaState (which can be accessed as a flow), and can be used to change the current state