Skip to content
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

Inject from multiple interfaces to singleton #53

Open
alebianco opened this issue Oct 26, 2015 · 0 comments
Open

Inject from multiple interfaces to singleton #53

alebianco opened this issue Oct 26, 2015 · 0 comments

Comments

@alebianco
Copy link
Contributor

Considering the class

class A implements IOne implements ITwo {
...
}

With the following mapping:

injector.map(IOne).toSingleton(A);
injector.map(ITwo).toSingleton(A);

I will get two separate instances of class A used for the respective injection points (at least in JS).
I would have expected to have one single instance to be provided whenever one of the interfaces is requested.

I can easily switch to a toValue() type of mapping to solve my case, I was just wondering if this is the expected behaviour and my assumption is totally wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant