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

Rethink lazy injection #34

Closed
benjohnde opened this issue Oct 19, 2019 · 1 comment
Closed

Rethink lazy injection #34

benjohnde opened this issue Oct 19, 2019 · 1 comment
Assignees
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@benjohnde
Copy link
Member

Currently lazy injection works through a different computed propery behaviour. Due to using an enum for @Inject it is mutating. Hence it is not really useful in a struct, as we are not allowed to alter a variable within a struct Cannot use mutating getter on immutable value: function call returns immutable value. And as 'mutating' may only be used on 'func' declarations we need a different approach.

@benjohnde benjohnde added bug Something isn't working question Further information is requested labels Oct 19, 2019
@benjohnde benjohnde added this to the 1.4.0 milestone Oct 19, 2019
@benjohnde benjohnde self-assigned this Oct 19, 2019
@benjohnde
Copy link
Member Author

We could possibly use @Inject var myService: MyServiceProtocol for lazy injection and var myService: MyServiceProtocol = resolve() for eager injection 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant