CLOVIS
06/16/2021, 7:21 PMremember
is used to keep values across recomposition (with a normal variable it would be re-computed everytime)
• State<T>
is used to represent something that can change overtime (or not)
The thing I don't understand is how Compose knows which state force a recompose, and which don't. I thought remember
was used to tell Compose that the current Composable
needed to ‘subscribe/observe' that state; however after reading other comments in this channel I'm confused whether I completely misunderstood something.Dominaezzz
06/16/2021, 7:40 PMMitchell Skaggs
06/16/2021, 7:51 PM@Composable
needs to "subscribe" to a state by creating a snapshot scope and listening for reads of states inside that scope. It keeps track of what states are read, and if they change it recomposes things (still listing for more reads of states). This handles any possible use of state variables, even if the use of a state is controlled by a condition based on another state.CLOVIS
06/16/2021, 8:00 PMMitchell Skaggs
06/16/2021, 8:01 PMCLOVIS
06/16/2021, 8:03 PMCLOVIS
06/16/2021, 8:03 PMDominaezzz
06/16/2021, 8:04 PMMitchell Skaggs
06/16/2021, 8:05 PMCLOVIS
06/16/2021, 8:08 PMZach Klippenstein (he/him) [MOD]
06/16/2021, 10:44 PMZach Klippenstein (he/him) [MOD]
06/16/2021, 10:45 PMZach Klippenstein (he/him) [MOD]
06/16/2021, 10:49 PMZach Klippenstein (he/him) [MOD]
06/16/2021, 10:50 PMgitai
06/17/2021, 7:05 AMCLOVIS
06/17/2021, 7:22 AMCLOVIS
06/17/2021, 7:22 AMgitai
06/17/2021, 7:38 AMCLOVIS
06/17/2021, 11:21 AMZach Klippenstein (he/him) [MOD]
06/17/2021, 4:09 PMZach Klippenstein (he/him) [MOD]
06/17/2021, 4:20 PMrunRecomposeConcurrentlyAndApplyChanges
, introduced heregitai
06/18/2021, 12:03 AMZach Klippenstein (he/him) [MOD]
06/18/2021, 12:47 AM