-
Notifications
You must be signed in to change notification settings - Fork 508
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
Proposition for function registration #458
Comments
Nice idea, but the first issue we need to resolve, is which one of the contributors is going to continue to maintain the project. |
Thanks for the response I did not realize the project was not maintained anymore :-( |
Hi, @twittemb I would be very interested in using your idea in my forked version of Swinject. |
Hi @davidthorn ok no pb. Will do. |
@davidthorn just opened a PR in your repo 👍 |
Hi everyone,
I've been using Swinject for 2 years now (very great project). Gradually, I have adopted a functional programming style and I need to register/resolve functions thanks to Swinject.
As there can be many functions having the same signature, the only way to discriminate them is using a name (from my understanding).
I have implemented a helper to avoid explicitly using names. It is called a
NamedService
. It is a protocol that provides a default name for you. All you have to do is declare the conformance to this protocol like that:And then you can register/resolve this namedService:
...
Would this be interesting to upstream this feature to the Swinject repo ? @jakubvano @yoichitgy
Thanks.
The text was updated successfully, but these errors were encountered: