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

Add ability to not inject lazily #5

Open
AKoulabukhov opened this issue Dec 3, 2019 · 1 comment
Open

Add ability to not inject lazily #5

AKoulabukhov opened this issue Dec 3, 2019 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AKoulabukhov
Copy link

Currently @Inject works lazily always. It means that object isn’t injected in fact until first call.
It can lead to unexpected behavior. For example you have some broadcasting object which performs logic in init() method and inject it on a root level. Then you try to observe some changes but this object still isn’t created.

The proposal is to add an option to propertyWrapper or registration methods to make this behavior configurable.

@SpectralDragon
Copy link
Member

I agree with you, that is bad and LazyInit was an easy solution to avoid a recursive init for nested objects.
Thanks for the issue and for example, it’ll help me to fix this.

@SpectralDragon SpectralDragon added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants