Are there any potential flaws with using `Disposab...
# compose
c
Are there any potential flaws with using
DisposableEffect
to handle tracking screen views? Seems it’s a pretty good fit to know when a Composable is shown on screen and then knows when it leaves the screen as well It’s not really a operation that needs cleaning up though, so maybe doesn’t fit the typical use case of
DisposableEffect
d
It's okay to leave
onDispose {}
empty. This is a supported use case of it as well.
s
If the
onDispose {}
is left empty, how is it different than a
LaunchedEffect(Unit) {}
?
d
There's a good answer somewhere in this channel about that. Something to do with dispatching but there is indeed a subtle difference.
s
Oh interesting, I would have guessed there is no difference. I would love to learn more about it, off to a Slack safari I go I guess 😅
d
It'll be from "Adam Powell" if that helps 😄 .
s
Well, this was fast https://kotlinlang.slack.com/archives/CJLTWPH7S/p1622560036078600?thread_ts=1622556885.065600&cid=CJLTWPH7S Of course it was Adam, I’ve learned so much from his messages on this slack channel over the months. It’s just a shame that most of them are getting buried in the sea of messages.
d
Someone out there should make an Adam compilation lol.
😍 3
s
#MakeItHappen