janishar / android-mvvm-architecture

This repository contains a detailed sample app that implements MVVM architecture using Dagger2, Room, RxJava2, FastAndroidNetworking and PlaceholderView
https://janisharali.com
Apache License 2.0
2.95k stars 936 forks source link

blogViewModel and openSourceViewModel VS ViewModelProviderFactory #54

Closed ghost closed 5 years ago

ghost commented 5 years ago

hi i checked both previous and new code and i have a question. as i see, you move all viewmodels to ViewModelProviderFactory and remove them from modules. Although you mention new OpenSourceViewModel(dataManager,schedulerProvider); and new BlogViewModel(dataManager,schedulerProvider); in ViewModelProviderFactory, you also provide them in OpenSourceFragmentModule and BlogFragmentModule. why did you do this ? thanks

jyotid commented 5 years ago

hey, Thanks for pointing it out. This looks like a mistake and we have rectified it and it will be available soon in the master branch. Reason being , now all the VM creation is delegated to VMFactory and hence there should not be any VM creation from any of the modules.

ghost commented 5 years ago

Thanks for answering me. you can close this issue