Cody Engel
10/24/2019, 5:32 AM+observe
isn’t quite I was hoping for, making the entire ViewModel observable with @Model
was more what I was hoping for.
I don’t think +observe
currently exists as part of the Canary build either? Android Studio at least can’t recognize it on my end.
I’ll try to stop by the office hours tomorrow to talk it through a bit more. Thanks again for all of the help and sorry for bugging ya at 10:30 at night 😅Luca Nicoletti
10/24/2019, 7:43 AM+observe
you’re looking for https://gist.github.com/lnicolet/b34ad41ef4a06b1161e1eb77cfb1163f#file-mvijetpackcomposeactivity-ktAdam Powell
10/24/2019, 12:52 PMLuca Nicoletti
10/24/2019, 12:53 PMviewModel
Adam Powell
10/24/2019, 12:56 PMLuca Nicoletti
10/24/2019, 12:56 PMobserve
on LiveData
providing the correct LyfeCycleOwner
?Adam Powell
10/24/2019, 1:04 PMLuca Nicoletti
10/24/2019, 1:06 PMonCommit
, onDispose
are not bound in any way to the Activity
lifecycle, are them?Adam Powell
10/24/2019, 1:26 PMsetContent {
helper but it won't stop and restart subscriptions based on started/stopped stateTODO
on it 🙂Flow.collect
in one without worryingLeland Richardson [G]
10/24/2019, 4:58 PM+observe
call is removed from the hierarchy, so will the subscriptiondisposeComposition
at the activity level if you want compose to properly clean up after itself thoughLuca Nicoletti
10/24/2019, 4:59 PMusework as well?onobserve
providing the correctLiveData
LyfeCycleOwner
observeForever
Leland Richardson [G]
10/24/2019, 5:11 PMLuca Nicoletti
10/24/2019, 5:11 PMonDispose{}
, just change the subscribeForever
Leland Richardson [G]
10/24/2019, 5:11 PMLuca Nicoletti
10/24/2019, 5:11 PMLeland Richardson [G]
10/24/2019, 5:12 PMdisposeComposition
in the right places, then it would do the same thing and wouldn’t be needed.