-
Notifications
You must be signed in to change notification settings - Fork 343
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
Controller Constructor Injection #510
Comments
Really good idea. |
You can see my example for dagger. |
@hijamoya Thanks for the sample. But in your sample I don't see constructor injection in controllers. They are still injecting to the member fields. |
For reference, here's an example of constructor injection with Fragments before FragmentFactory was introduced: https://github.com/Miha-x64/Flawless/ |
Currently, when injecting dependencies into a
Controller
, we can't perform constructor injection because Conductor needs to be able to recreate the Controllers after a configuration change. This sucks because field injection is confusing and error-prone.Can we provide an abstraction like a
ControllerFactory
which would behave similarly toandroidx.work.WorkerFactory
in that consumers could override it with their ownControllerFactory
?The text was updated successfully, but these errors were encountered: