Hey, since we won't need multiple fragments anymore with compose navigation and can go single activi...
p
Hey, since we won't need multiple fragments anymore with compose navigation and can go single activity, what would be the best practice for injecting viewmodels with hilt? Injecting them all in the activity and then pass them down?
a
probably nav-graph scoped viewmodels
☝️ 4
p
Cheers. How would one achieve that? Still fairly new to programming & android in general, couldn't find a fitting scope annotation in the hilt docs.
a
Checkout this gist full article
Still fairly new to programming & android in general,
Best of luck πŸ™‚ , Dagger already has a high learning curve, and Hilt is just something that supports Dagger. Though Hilt is supposed to simplify things
πŸ‘ 1
πŸ‘ 1
Compose is working on built-in support for scoping viewModels within a Composable AFAIK, but it’s not yet available
πŸ‘€ 1
p
Thanks mate, i'll have a look πŸ™‚!