dimsuz
06/06/2022, 12:28 PM@Composable
functions as objects in this regard, but that's not true, is it? A function itself doesn't have anything to do with composition lifecycle: only its effects do. Is there some good mental model to think about this?Stylianos Gakis
06/06/2022, 1:37 PMvar someVar: Boolean
if (someVar) {
MyComposable()
}
When someVar becomes false, the MyComposable
leaves composition as it no longer is shown. remember
s inside the composable function itself get destroyed etc.
When it becomes true again, MyComposable
gets put back into the slot table, therefore all of its LaunchedEffect(Unit)
etc. are run. It “enters composition”.
This is the first thought that comes to my mind when you say all this, is this what you’re looking for? If not please ask away. I do not know what you mean exactly by saying that you’re thinking of them as objects.dimsuz
06/06/2022, 2:14 PMStylianos Gakis
06/06/2022, 2:19 PMdimsuz
06/06/2022, 2:35 PMZach Klippenstein (he/him) [MOD]
06/07/2022, 3:25 PMdimsuz
06/07/2022, 6:02 PMStylianos Gakis
06/07/2022, 6:16 PM