How can a dependency be scoped to a sharedViewMode...
# koin
a
How can a dependency be scoped to a sharedViewModel and then be injected into a non-shared viewModel?
In Practice there is a container fragment, which is the host of a sharedViewModel, which holds a repository, which should be available to all subfragments of the container fragment('s viewmodels)
the repository instance should be scoped to the sharedViewModel
a
How can a dependency be scoped to a sharedViewModel and then be injected into a non-shared viewModel?
seems really weird usecase
perhaps ViewModel is not the tool you need
a
Our UseCase is basically a screen flow of a couple of subscreens contained in a parentFragment (think a viewpager inside a parent fragment). Every subscreen is a part of a form, which in the end will fill a data class which is then submitted. The data class is stored inside of a repo. The repo should be available for every subscreen, but cleared when the whole form (the parentFragment) is closed.
Maybe it's a weird usecase, but its just an extension of scoping. The repo should be scoped to the lifecycle of the sharedViewModel.