-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There is a [JavaScript proposal](https://github.com/tc39/proposal-explicit-resource-management) for using `Symbol.dispose` as a way to automatically clean up resources. You do that by declaring variables like so: ```js using resource = new Resource(); ``` The variable `x` will be automatically disposed when it goes out of scope. We used to have our own `dispose` method and `with` helper method that allows scoped access to the resource, before it gets cleaned up at the end. TypeScript already fully implements and polyfills support for it, so we can already fully switch over to it.
- Loading branch information
Showing
1 changed file
with
10 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters