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

Option to set Scope.Singleton by default #71

Open
koldoon opened this issue Aug 18, 2020 · 0 comments
Open

Option to set Scope.Singleton by default #71

koldoon opened this issue Aug 18, 2020 · 0 comments

Comments

@koldoon
Copy link

koldoon commented Aug 18, 2020

Hi! I've got a suggestion of configuration parameter that tells Container to treat all the dependencies as Singletons.

The common pattern of IoC usage is to build application architecture. In this case most of Services and Controllers acts as singletons and just a few must be instantiated every time (btw, I think this is not a good option for using IoC container at all, but anyway).

So I would wanted to have smth like this:
Container.configure({ defaultScope: Scope.Singleton });

P.S. I know, currently configure() is used for another purpose, I describe just a concept.

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