Tolriq
12/09/2021, 5:53 PMAndrey Kulikov
12/13/2021, 12:44 PMTolriq
12/13/2021, 2:20 PMAndrey Kulikov
12/13/2021, 3:06 PMTolriq
12/13/2021, 3:34 PM@Composable
fun Wrapper(content: @Composable () -> Unit) {
content()
}
To prevent parent recomposition in some cases when it's costly.
The question was more about the whole wording, even if I extract the composable I'll still pass the state to each calls and since the value change all extracted functions will be called again so no real difference here. Imagine having a list of items collected from jetpack paging and the other states would be the connection status to different servers.
I can either collect a lastconnectionstatus change at the lazylist level that will trigger recomposition of all the child so doing a full tree checks for actual changes. Or I can have each item collecting the actual state of the server they are related to and so only update themselves and not triggering a whole recomposition. But the collect start a coroutine / stop it and allocate during scrolling, so it was more a theory question about what pattern is best now and in the future? Is tree checking for change more "costly" than the cost of more granularity in updates added by the collect/stop collecting things.Andrey Kulikov
12/13/2021, 7:58 PMTolriq
12/13/2021, 8:34 PM