So i’m starting to explore the navigation component in compose, and so far i’m loving it. The issue i’m hitting is with view models. A lot of the tutorials around the view models are focused on hilt applications. That’s well and good, except if you’re not using hilt for various reasons. Number 1 being that hilt can’t be used as part of a library, you have to do the entire app’s compile in one compile run. And i’m not talking a “multi-module” project, which hilt supports. I’m talking a library packaged as an .aar and brought into an application. Previously, i’d use an extension function i created off of ViewModelProvider which would use a factory driven by a lambda you gave it:
viewModelOf { MyViewModel(someService) }