Marko Novakovic
04/22/2021, 8:21 PMrememberUpdatedState
. what is it used for and what is it really doing? am trying to write some code in order to test/grasp what’s it doing but still nothingZach Klippenstein (he/him) [MOD]
04/22/2021, 8:40 PM@Composable
fun <T> rememberUpdatedState(newValue: T): State<T> = remember {
mutableStateOf(newValue)
}.apply { value = newValue }
Zach Klippenstein (he/him) [MOD]
04/22/2021, 9:10 PMrememberUpdatedState
ensures that new values from future recompositions will be seen by lambdas that live over a longer time frame (i.e. multiple compositions).Marko Novakovic
04/23/2021, 6:51 AM