-
-
Notifications
You must be signed in to change notification settings - Fork 153
Suppor for using the same instanceName multiple times for different types #78
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
Comments
I think allowing this would make GetIt more complex. You are the first one asking for this. If others want it too I will consider it. |
I agree this is important. In Dagger we have the @nAmed annotation to get two different instances of the same type. Repository class may depends different type of local sources e.g moor or sqflite. |
I still fail to see how you need multiple instances of the same repository for the same user o.O |
I guess you are not using much of abstraction in your codebase. Most complex example is in domain, with multiple use cases on same contract managing this with strings names or class types is time consuming. But there is no other way so far. Remember that im using injectable, library for generating get_it code, couse in bigger projects it is hard to manually maintain all dependencies. |
When I would add this you would be required to pass always the type together the name when accessing your objects |
@Pawelo93 is there any update on this issue? |
Hi, this is now supported in get_it V5.0.0 |
Uh oh!
There was an error while loading. Please reload this page.
Hello @escamoteur, I was wondering if it is possible to allow using same instance name for different class types. For example i have two kinds of repositories (different type) and and want to register two of them with name 'local', and all the others repositories with name 'remote'.
Thank you :)
The text was updated successfully, but these errors were encountered: