nicojs / typed-inject

Type safe dependency injection for TypeScript
Apache License 2.0
439 stars 23 forks source link

feat(async dispose): allow asynchronous `dispose` #4

Closed nicojs closed 5 years ago

nicojs commented 5 years ago

This feature allows for dispose of your dependency to return a promise. Calling dispose on its injector will await this promise. This, in turn, makes myInjector.dispose asynchronous and you should await it.

BREAKING CHANGE: Dependencies are now disposed of asynchronously (while still honoring the order of "child first"). You should now await the result of injector.dispose().