Package-level declarations
Properties
Link copied to clipboard
LifecycleOwner holder to use collectAsStateWithLifecycle.
Functions
Link copied to clipboard
fun <T> StateFlow<T>.collectAsStateWithLifecycle(lifecycle: Lifecycle, minActiveState: Lifecycle.State = Lifecycle.State.STARTED, context: CoroutineContext = EmptyCoroutineContext): State<T>
fun <T> StateFlow<T>.collectAsStateWithLifecycle(lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, minActiveState: Lifecycle.State = Lifecycle.State.STARTED, context: CoroutineContext = EmptyCoroutineContext): State<T>
Collects values from this StateFlow and represents its latest value via State in a lifecycle-aware manner.
fun <T> Flow<T>.collectAsStateWithLifecycle(initialValue: T, lifecycle: Lifecycle, minActiveState: Lifecycle.State = Lifecycle.State.STARTED, context: CoroutineContext = EmptyCoroutineContext): State<T>
fun <T> Flow<T>.collectAsStateWithLifecycle(initialValue: T, lifecycleOwner: LifecycleOwner = LocalLifecycleOwner.current, minActiveState: Lifecycle.State = Lifecycle.State.STARTED, context: CoroutineContext = EmptyCoroutineContext): State<T>
fun <T> StateFlow<T>.collectAsStateWithLifecycle(initialValue: T, lifecycle: Lifecycle, minActiveState: Lifecycle.State = Lifecycle.State.STARTED, context: CoroutineContext = EmptyCoroutineContext): State<T>
Collects values from this Flow and represents its latest value via State in a lifecycle-aware manner.
Link copied to clipboard
suspend fun <T> Flow<T>.collectOnLifecycle(lifecycle: Lifecycle, state: Lifecycle.State = Lifecycle.State.STARTED, collector: FlowCollector<T>)
suspend fun <T> Flow<T>.collectOnLifecycle(lifecycleOwner: LifecycleOwner, state: Lifecycle.State = Lifecycle.State.STARTED, collector: FlowCollector<T>)
Link copied to clipboard
fun <T> Flow<T>.collectOnLocalLifecycle(state: Lifecycle.State = Lifecycle.State.STARTED, collector: FlowCollector<T>)
Link copied to clipboard
fun <T> Flow<T>.flowWithLifecycle(lifecycle: Lifecycle, minActiveState: Lifecycle.State = Lifecycle.State.STARTED): Flow<T>
fun <T> Flow<T>.flowWithLifecycle(lifecycle: LifecycleOwner, minActiveState: Lifecycle.State = Lifecycle.State.STARTED): Flow<T>
Link copied to clipboard
suspend fun Lifecycle.repeatOnLifecycle(state: Lifecycle.State = Lifecycle.State.STARTED, block: suspend CoroutineScope.() -> Unit)
Runs the given block in a new coroutine when this
Lifecycle is at least at state and suspends the execution until this
Lifecycle is Lifecycle.State.DESTROYED.
suspend fun LifecycleOwner.repeatOnLifecycle(state: Lifecycle.State = Lifecycle.State.STARTED, block: suspend CoroutineScope.() -> Unit)
LifecycleOwner's extension function for Lifecycle.repeatOnLifecycle to allow an easier call to the API from LifecycleOwners such as Activities and Fragments.
Link copied to clipboard
fun <T> Flow<T>.withLocalLifecycle(minActiveState: Lifecycle.State = Lifecycle.State.STARTED): Flow<T>