-
Notifications
You must be signed in to change notification settings - Fork 144
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
How to solve circular dependency? #396
Comments
Full example
|
Thanks for the full example, but I don't think this has anything to do with Needle. Consider this code:
Even if there's no Needle, this print statement will run into the same issue. |
@rudro thanks for your feedback!
|
Legit question. It's of course not possible to resolve circular dependency statically (by the very nature of the problem), but usually these use cases can be dealt with the usage of lazy injection, i.e. one of the dependencies in the circle is not resolved statically, but only injected upon usage. Needle seems to be inspired by dagger somewhat, so this link might help. |
Here is an example of a component
Now needle stucks in runtime try to resolve it. Is there a way to fix it?
Thanks
The text was updated successfully, but these errors were encountered: