-
Notifications
You must be signed in to change notification settings - Fork 72
Added support for up to six runtime arguments #8
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
Conversation
…er of runtime arguments moved Definition and run time arguments to separate files
Dip/Dip/Definition.swift
Outdated
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.
I was confused at first to see that we stored the factory closure in the DefinitionKey. I now understand that in fact you store the factory signature / Type in there, to store the expected runtime argument types.
So here we probably need to find a different name for this property, to make it less confusing with the other places when we use the term factory which expect an actual closure, while in DefinitionKey that's the closure type, not the closure itself.
I only understood that when I saw your let key = DefinitionKey(protocolType: T.self, factory: F.self, associatedTag: tag) here, seeing that you used F.self there.
Simply renaming this to factoryType or factorySignature or whatnot would make things clearer I think.
I'm OK with that, but I think maybe we should make it more consistent throughout the API. Probably make the |
|
@ilyapuchka Thanks for this promising work! I only reviewed it directly on GitHub for now, looks OK so far but will have to take another look and open the code in Xcode to properly check it out and review it better. Will keep you posted. |
|
|
Thanks for review, @AliSoftware, agree with all comments. |
cb86c94 to
021906c
Compare
021906c to
b5fca0a
Compare
222ce35 to
f1c7c52
Compare
|
I wonder why sometimes Travis fails the compilation at the "▸ Touching DipTests.xctest" stage 😕 I promise I'll check this out tomorrow and hopefully we can finally merge it 😉 |
11f18d4 to
9fc63ff
Compare
9fc63ff to
2ea5e17
Compare
|
Done. Also fixed some documentation slightly. |
|
I think this thread may address Travis issue - travis-ci/travis-ci#4725 |
|
Ah good point on the Travis Thread, will keep an eye on it |
(So it doesn't risk to be included by mistake to one of the project target, and to avoid confusing the user opening the Sample app)
|
Perfect 👌 Finally, I have time to merge this, sorry for the delay! |
Added support for up to six runtime arguments
|
(Note: you'll probably want to rebase your |
To register factories/instances it's now possible to use up to six runtime arguments. Clients can extend this number on demand.
@AliSoftware Please review it again. There are few changes that I want to note:
resolvemethod that accepts only tag parameter, so I had to maketagparameter named.