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

Expose registered singletons or lazy singletons #398

Open
dannygmr opened this issue Jan 19, 2025 · 0 comments
Open

Expose registered singletons or lazy singletons #398

dannygmr opened this issue Jan 19, 2025 · 0 comments

Comments

@dannygmr
Copy link

dannygmr commented Jan 19, 2025

I would like to have the following functionality:

To get all services that implement a particular interface, not just factories or named factories.

class A implements Cleanable{
.
.
.
}

class B implements Cleanable{
.
.
.
}

final result =  GetIt.GetAll<Cleanable>() // result [A,B]

That way, when I log out, I can call clean on all "cleanable" classes. Or, better yet, let me access all registered services in the provided scope or default current, and I will filter out by type.
It will bring additional value to getIt since the developer will not have to remember to register those services with additional friction on some other form of registration management to call all of the "cleanable" services together.

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