Open agustinsivoplas opened 6 years ago
The purpose is to allow the dependency injection with dagger to ViewModels.
Thanks, but in that case all view models will be singleton? Whats happen if I have multiple instances of a fragment (the same fragment) but I dont want to share the same view model?
Thanks, but in that case, all view models will be a singleton? Whats happens if I have multiple instances of a fragment (the same fragment) but I don't want to share the same view model?
I think with Koin you can get this. sharedViewModel
if you want to shared between multiple instances of a fragment, use viewModel
to avoid using same view model.
But, in Dagger, I still have no experiences about it. @agustinsivoplas
Why you have to override the in ViewModelFactory? What is the purpose DaggerViewModelFactory? What is wrong with the default implementation of ViewModelFactory?