One of the most up to date samples covering Android Architecture Components is GithubBrowserSample provided by Google. I reviewed the code and a few questions arose:
I have noticed that ViewModelModule is included in AppModule. It means that all the viewmodels are added to the DI graph. Why that is done in that way instead of having separate
Modulefor each Activity/Fragment that would provide only neededViewModelfor specific Activity/Fragment?In this specific example, where viewmodels are instantiated using GithubViewModelFactory is there any way to pass a parameter to the specific
ViewModel? Or the better solution would be to create a setter inViewModeland set needed param via setter?