Compose question but android ish specific so I'm going to ask here first.
I have an app with all fragments. I currently check in every fragment if my user is logged out. I follow Ian Lakes video on navigation and everything works really well.
I'm moving fully to compose now, no fragments and so now I'm curious how I would do the same check. Overall just curious if someone has docs on how to tackle this use case in pure compose.
Basically is there something like this
https://youtu.be/09qjn706ITA▾
4:48 but for compose?
i
Ian Lake
07/15/2021, 5:26 AM
Just do the exact same thing? You can
observeAsState()
on a `SavedStateHandle`'s LiveData
c
Colton Idle
07/15/2021, 9:25 PM
Thanks, so this would mean that I have to use AAC VMs?
i
Ian Lake
07/15/2021, 9:30 PM
You could have your own storage system that is tied to the unique IDs of each
NavBackStackEntry
, but the only signal on when to clear that key/value would be...a `ViewModel`'s
onCleared()
Ian Lake
07/15/2021, 9:30 PM
As Compose offers no permanently destroyed signal itself
c
Colton Idle
07/15/2021, 9:46 PM
Hm. This may put a bit of a dent in my single activity, all compose, no AAC VMs plans.