stateInWhileSubscribed

context(viewModel: ERROR CLASS: Symbol not found for ViewModel)
fun <T> ERROR CLASS: Symbol not found for Flow<T>.stateInWhileSubscribed(initialValue: T, stopTimeout: ERROR CLASS: Symbol not found for Duration = 5.seconds): ERROR CLASS: Symbol not found for StateFlow<T>(source)

Extension for converting a Flow to a StateFlow in a ViewModel context.

Parameters

initialValue

the initial value of the state flow

stopTimeout

configures a delay between the disappearance of the last subscriber and the stopping of the sharing coroutine.