dimsuz
04/18/2021, 11:07 PMContent(viewStates.collectAsState().value)
@Composable fun Content(state: ViewState) {
Text(text = state.title)
Text(text = state.description)
}
Would both Texts be always recomposed even if (for example) there were 5 emissions and in all 5 only title was changing?Adam Powell
04/19/2021, 12:28 AMContent
function will recompose, but each individual Text
function may skip/return early if the parameters are stable and match the previous recompositiondimsuz
04/19/2021, 10:26 AMZach Klippenstein (he/him) [MOD]
04/19/2021, 12:15 PMStable
annotation define it: https://developer.android.com/reference/kotlin/androidx/compose/runtime/Stabledimsuz
04/19/2021, 12:48 PM