You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we can register few definitions with different tags and one with no tag, which will be used as a default if we try to resolve component using unknown tag.
But it does not work the other way - if we don't register definition without tag we will not be able to resolve component without providing tag.
Would it be useful to be able to setup definition with tag as a default and later be able to resolve it without setting tag?
container.register(tag:"facebook", useByDefault:true){FacebookOAuth()asOAuth}
container.register(tag:"twitter"){TwitterOAuth()asOAuth}
container.register(tag:"google"){GoogleOAuth()asOAuth}
container.resolve()asOAuth // will resolve FacebookOAuth
container.register(){TwitterOAuth()asOAuth} // will override previous default
container.resolve("tumblr")asOAuth // should not resolve, because user explicitly specified unknown tag
The text was updated successfully, but these errors were encountered:
Interesting idea but I don't think it's worth it. one can simply register the same block with both the tag and nil if they want that behavior.
I think that kind of logic belong to each application's code anyway and is not worth adding a parameter (even optional) for that marginal case.
Currently we can register few definitions with different tags and one with no tag, which will be used as a default if we try to resolve component using unknown tag.
But it does not work the other way - if we don't register definition without tag we will not be able to resolve component without providing tag.
Would it be useful to be able to setup definition with tag as a default and later be able to resolve it without setting tag?
The text was updated successfully, but these errors were encountered: