Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide ViewModelModule into several feature based module? #34

Open
jaychang0917 opened this issue Jun 8, 2018 · 2 comments
Open

Divide ViewModelModule into several feature based module? #34

jaychang0917 opened this issue Jun 8, 2018 · 2 comments

Comments

@jaychang0917
Copy link

jaychang0917 commented Jun 8, 2018

In a real-world app, there will be many features. Currently the ViewModelModule is responsible to provide all the ViewModels, is it better that each feature gets its ViewModels from its own component instead of the ApplicationComponent?

@android10
Copy link
Owner

What you are saying is more than valid, but DI was out of scope and using Dagger is an implementation detail.

With that being said we could use this issue to discuss about different approaches we can take regarding DI.

@aaghan
Copy link

aaghan commented Apr 9, 2020

I inherited ViewModelFactoryModule in different module to achieve it. It came quite hard to figure out injection could not be done unless one viewmodel injects in constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants