toInitializedSubject

fun <T> MutableStateFlow<T>.toInitializedSubject(coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): StateFlowInitializedSubject<T>

Converts a MutableStateFlow to a StateFlowInitializedSubject

Parameters

coroutineScope

The CoroutineScope on which to observe the MutableStateFlow

context

The CoroutineContext in which to observe the MutableStateFlow


fun <T> MutableSharedFlow<T>.toInitializedSubject(initialValue: T, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): SharedFlowInitializedSubject<T>

Converts a MutableSharedFlow to a SharedFlowInitializedSubject

Parameters

initialValue

The initial value to observe until the MutableSharedFlow emits.

coroutineScope

The CoroutineScope on which to observe the MutableSharedFlow

context

The CoroutineContext in which to observe the MutableSharedFlow


fun <T> ReadWriteProperty<Any?, T>.toInitializedSubject(coroutineScope: CoroutineScope? = null, context: CoroutineContext? = coroutineScope?.coroutineContext): ReadWritePropertyInitializedSubject<T>

Converts a ReadWriteProperty to a ReadWritePropertyInitializedSubject

Parameters

coroutineScope

The CoroutineScope on which to emit changes to the ReadWriteProperty

context

The CoroutineContext in which to emit changes to the ReadWriteProperty