stateInDelayed

fun <T> Flow<T>.stateInDelayed(initialValue: T, scope: CoroutineScope): StateFlow<T>

Returns a StateFlow that represents the last value emitted by the Flow

Return

A StateFlow that represents the last value emitted by the Flow

Parameters

initialValue

The initial value of the StateFlow

scope

The CoroutineScope to be used for the StateFlow