asMutableComposeState

fun <T> Flow<T>.asMutableComposeState(initial: T, scope: CoroutineScope, useContextOnChange: CoroutineContext? = Dispatchers.Main, onException: ExceptionHandler<T?> = defaultSafelyWithoutExceptionHandlerWithNull): <Error class: unknown class><T>(source)

Will map this as MutableState. Returned MutableState WILL NOT change source Flow

Parameters

initial

First value which will be passed to the result MutableState

scope

Will be used to subscribeSafelyWithoutExceptions on this to update returned MutableState

useContextOnChange

Will be used to change context inside of subscribeSafelyWithoutExceptions to ensure that change will happen in the required CoroutineContext. Dispatchers.Main by default

onException

Will be passed to the subscribeSafelyWithoutExceptions as uncaught exceptions handler


inline fun <T> StateFlow<T>.asMutableComposeState(scope: CoroutineScope, useContextOnChange: CoroutineContext? = Dispatchers.Main, noinline onException: ExceptionHandler<T?> = defaultSafelyWithoutExceptionHandlerWithNull): <Error class: unknown class><T>(source)

Will map this as MutableState. Returned MutableState WILL NOT change source StateFlow. This conversation will pass its StateFlow.value as the first value

Parameters

scope

Will be used to subscribeSafelyWithoutExceptions on this to update returned MutableState

useContextOnChange

Will be used to change context inside of subscribeSafelyWithoutExceptions to ensure that change will happen in the required CoroutineContext. Dispatchers.Main by default

onException

Will be passed to the subscribeSafelyWithoutExceptions as uncaught exceptions handler