Jason Ankers
01/25/2021, 7:19 AMfmasa
01/25/2021, 9:20 AMAmbientViewModelStoreOwner
is scoped to NavBackEntry by default. But you can pass "parent" AmbientViewModelStoreOwner
(the ambient value passed to given NavHost
) as your own ambient.fmasa
01/25/2021, 9:21 AMAmbientActivity
) to scope few viewmodels that are used everywhere to ActivityJason Ankers
01/25/2021, 9:36 AMdefaultViewModelProviderFactory
, do you know if theres a substitute in compose?
Before compose I had this: https://developer.android.com/training/dependency-injection/hilt-jetpack#viewmodel-navigationfmasa
01/25/2021, 9:40 AMFunkyMuse
01/25/2021, 11:09 AMfmasa
01/25/2021, 11:14 AMnavGraphViewModels
, right? AmbientViewModelStoreOwner
(used by viewModel()
) is NavBackStackEntry
.Ian Lake
01/25/2021, 3:11 PMNavBackStackEntry
of parent graphs as well as a new Hilt Navigation artifact which gives you access to a properly scoped Hilt ViewModelProvider.Factory
Jason Ankers
01/25/2021, 4:08 PM