-
-
Save burnoo/30c6915cc06c361d2b49a950147be684 to your computer and use it in GitHub Desktop.
Two-way data binding in Jetpack Compose 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun <T> MutableStateFlow<T>.collectAsMutableState( | |
context: CoroutineContext = EmptyCoroutineContext | |
): MutableState<T> = MutableStateAdapter( | |
state = collectAsState(context), | |
mutate = { value = it } | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment