I’d create that in a dagger module and inject it into my fragment/activity. With compose, you’re not dealing with individual fragments, so you can’t just scope the view models to the fragment’s ViewModelStore. Does compose provide it’s own ViewModelStore attached to the current composable?
i
Ian Lake
06/01/2021, 4:30 PM
Navigation Compose automatically scopes calls to
viewModel()
to the current screen whenever you use that method within a