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

support dispose for all instances #210

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blake-mealey
Copy link

My team recently adopted the container.dispose method for our project but found it wasn't working for us. It turns out the current dispose method only disposes instances which were created via the "constructor" registration (e.g. container.register(ClassName)). Our project exclusively uses factory and value providers so this doesn't work for us.

In this PR I've updated the internal logic to support disposal for any resolved instance.

@risen228
Copy link

Maybe it's too late, but as I remember, I ran into the same problem in my projects, so I added this feature in my fork

@blake-mealey
Copy link
Author

Maybe it's too late, but as I remember, I ran into the same problem in my projects, so I added this feature in my fork

Too late for me (my company ripped out tsyringe haha) but thanks for the heads-up. Might check out your fork in the future.

@julienblin
Copy link

+1 on this - Would love to have that feature merged please 🙏.
This can be the source of subtle bugs.

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

Successfully merging this pull request may close these issues.

3 participants