BaseLocationStateRepo
abstract class BaseLocationStateRepo(createNotInitializedState: () -> LocationState.NotInitialized, createInitializingState: suspend ColdStateFlowRepo<LocationState>.(LocationState.Inactive) -> suspend () -> LocationState.Initializing, createDeinitializingState: suspend ColdStateFlowRepo<LocationState>.(LocationState.Active) -> suspend () -> LocationState.Deinitialized, coroutineContext: CoroutineContext) : ColdStateFlowRepo<LocationState>
An abstract ColdStateFlowRepo for managing LocationState
Parameters
createNotInitializedState
method for creating the initial LocationState.NotInitialized State
createInitializingState
method for transitioning from a LocationState.Inactive into a LocationState.Initializing given an implementation of this ColdStateFlowRepo
createDeinitializingState
method for transitioning from a LocationState.Active into a LocationState.Deinitialized given an implementation of this ColdStateFlowRepo
coroutineContext
the CoroutineContext the CoroutineContext used to create a coroutine scope for this state machine.
Inheritors
Constructors
Link copied to clipboard
constructor(createNotInitializedState: () -> LocationState.NotInitialized, createInitializingState: suspend ColdStateFlowRepo<LocationState>.(LocationState.Inactive) -> suspend () -> LocationState.Initializing, createDeinitializingState: suspend ColdStateFlowRepo<LocationState>.(LocationState.Active) -> suspend () -> LocationState.Deinitialized, coroutineContext: CoroutineContext)
Properties
Link copied to clipboard
Link copied to clipboard
val deinitChangeStateWithRepo: suspend (LocationState, ColdStateFlowRepo<LocationState>) -> suspend () -> LocationState?
Link copied to clipboard
Link copied to clipboard
val initChangeStateWithRepo: suspend (LocationState, ColdStateFlowRepo<LocationState>) -> suspend () -> LocationState
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Transforms a Flow of LocationState into a flow of its associated optional Location.KnownLocation
Link copied to clipboard
Link copied to clipboard
fun launchTakeAndChangeState(context: CoroutineContext, action: suspend (LocationState) -> suspend () -> LocationState): Job
fun <K : LocationState> launchTakeAndChangeState(context: CoroutineContext, remainIfStateNot: KClass<K>, action: suspend (K) -> suspend () -> LocationState): Job
Link copied to clipboard
fun <Result> launchUseState(context: CoroutineContext, action: suspend (LocationState) -> Result): Job
Link copied to clipboard
Transforms a Flow of LocationState into a flow of its associated Location
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun takeAndChangeState(action: suspend (LocationState) -> suspend () -> LocationState): LocationState
suspend fun <K : LocationState> takeAndChangeState(remainIfStateNot: KClass<K>, action: suspend (K) -> suspend () -> LocationState): LocationState