-
Notifications
You must be signed in to change notification settings - Fork 17
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 the option to resolve dependencies by name #39
Add the option to resolve dependencies by name #39
Conversation
Oh my gosh that's amazing! @brototyp I am going to review your PR tomorrow. Thank you so much for your work! I am so happy right now to see some interest in that tiny DI library :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I like the usage of AnyHashable
and also the new ComponentIdentifier
. Thank you very much for your contribution!
Wohoo. Awesome! Thanks for your fast review! |
Oh yeah. I totally forgot as well. Looks like we both were a little to excited about it 😊 |
Hey @benjohnde, just a gentle ping from my side. Is there any way we can get the release train rollin'? Either straight as it is, or with #22? (Also: Do you need any support on #22? Maybe some brainstorming and bouncing off ideas?) |
I am ultimately sorry for having merged your contribution and not releasing it. I totally love the way you implemented the resolving dependencies by name feature. I am going to finalise the release tomorrow @brototyp 🎉🚀. |
Don't worry about it. I know that it's hard to follow up on such side projects. |
I just finished the release, you are free to use the new version 1.6.0. Podspec was also pushed to Cocoapods 🎉 ! |
Implements #8
This PR add functionality to resolve dependencies by name or in this case tag.
In order to do so, I changed the following:
A component no longer has a
tag: String
but anlet identifier: AnyHashable
. This identifier is used to reference theComponent
as well as the instance in theContainer
(ComponentStack
andInstanceStack
). I also added aComponentIdentifier
struct that uses theType
of the factory as well as an optionaltag
to calculate thehashValue
. So instead of a String of the Type, we now use the hashValue of the type to identify a Component or an instance in our Container.Next I added an optional
tag: AnyHashable
parameter to all functions that are used to register or resolve dependencies.I didn't write any documentation in the
README
yet since I first wanted to get some feedback about this first. I am looking forward to hear ideas on how this could be improved.