InitialValueFlow

class InitialValueFlow<T : Any>(flow: Flow<T>) : Flow<T>

A Flow implementation that emits the current value of a widget immediately upon collection.

Constructors

Link copied to clipboard
fun <T : Any> InitialValueFlow(flow: Flow<T>)

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<T>)
Link copied to clipboard
fun skipInitialValue(): Flow<T>

Returns a Flow that skips the initial emission of the current value.

Extensions

Link copied to clipboard
fun <T : Any> Flow<T>.asInitialValueFlow(initialValue: () -> T): InitialValueFlow<T>

Converts a Flow to an InitialValueFlow, taking an initialValue lambda for computing the initial value.