LocationStateImplRepo

open class LocationStateImplRepo(createLocationManager: suspend () -> LocationManager, coroutineContext: CoroutineContext) : BaseLocationStateRepo

A BaseLocationStateRepo managed using a LocationManager

Parameters

createLocationManager

method for creating the LocationManager to manage the LocationState

coroutineContext

the CoroutineContext the CoroutineContext used to create a coroutine scope for this state machine.

Inheritors

Constructors

Link copied to clipboard
constructor(createLocationManager: suspend () -> LocationManager, coroutineContext: CoroutineContext)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val lazyMutableFlow: Lazy<MutableStateFlow<LocationState>>
Link copied to clipboard
open override val stateFlow: StateFlow<LocationState>
Link copied to clipboard
val subscriptionCount: StateFlow<Int>

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<LocationState>): Nothing
Link copied to clipboard
open suspend override fun firstCollection()
Link copied to clipboard
suspend override fun initialValue(): LocationState
Link copied to clipboard
fun Flow<Location>.known(maxAge: Duration = 0.seconds): Flow<Location.KnownLocation?>

Transforms a Flow of LocationState into a flow of its associated optional Location.KnownLocation

Link copied to clipboard
open suspend override fun laterCollections(): LocationState
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
fun Flow<LocationState>.location(): Flow<Location>

Transforms a Flow of LocationState into a flow of its associated Location

Link copied to clipboard
suspend override fun noMoreCollections(): LocationState
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
Link copied to clipboard
suspend fun <Result> useState(action: suspend (LocationState) -> Result): Result