microsoft / tsyringe

Lightweight dependency injection container for JavaScript/TypeScript
MIT License
5.19k stars 172 forks source link

[feat] Add support for cleaning up disposable instances, part deux #183

Closed mikl closed 2 years ago

mikl commented 3 years ago

As follow-up to microsoft/tsyringe/pull/132 by @Xapphire13 here’s a PR that addresses some of the points raised in that PR:

  1. More test coverage for what happens if you try to use a disposed container.
  2. Support for async disposables.
  3. Minor typo fixes.

That leaves the question raised by @meltingmosaic:

what happens for array-type (@injectAll type) resolutions - do we resolve each element in the array?

For those I’m not quite sure what to do. Any guidance?

Closes #127

ghost commented 3 years ago

CLA assistant check
All CLA requirements met.

MeltingMosaic commented 3 years ago

@Xapphire13 , could you take a look? I will too, but you probably have more context here.

mikl commented 3 years ago

Thanks.

I get this warning message:

First-time contributors need a maintainer to approve running workflows.

As explanation to why the tests are not running. Could someone with access approve it?

blake-mealey commented 2 years ago

My team would like to use this feature. When can we expect the latest version including this change to be released?

mikl commented 2 years ago

@blake-mealey this change was already included in the latest release (4.7.0). You can go ahead and use Disposable in your project, I already do :)