-
Notifications
You must be signed in to change notification settings - Fork 257
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
My modular cannot register Client and Network #933
Comments
try only: i.add<Client>(http.Client.new);
i.add<Network>(Network.new); |
unfortunately it didn't work, I'm starting to think it might be a bug that happened. |
Could you provide a complete code so that I can reproduce the error? |
this is the file with the part that has the error, I made several changes to it to try to find out the reason for the error, for example, now I am no longer calling network in app_modular but in home_module to see if the behavior changes. |
Hi @raj-ueslem In void binds(Injector i) {
i.add<http.Client>(http.Client.new);
i.add<Network>(Network.new);
i.add<HomeInterface>(HomeService.new);
i.addSingleton(HomeStoreAction.new);
i.addSingleton(HomeStoreState.new);
} |
It worked, wow, I'm very happy hahaha If you still have some patience left, could you explain to me why it wasn't working before? I don't think I understood very well. From what I saw, the instances I was using were unnecessary xD |
I'm doing a project that consumes data that I created in mockapi but I'm not able to make the modular register my http.Client class that comes from http nor my Network that needs http, the other classes were created and instantiated without problems.
in some situations it registers but says that the class already exists but if you remove anything for example:
and change to:
in this situation it says that the class was not instantiated, regardless of what you add or remove, the errors always remain between saying that the class was not registered or that it already exists. I don't know what it could be, I must have already tried almost everything I know from the old one and what I studied from the new modular :(
The text was updated successfully, but these errors were encountered: