ya-webadb
ya-webadb copied to clipboard
[Suggestion] Use `Symbol.dispose` to replace our own `Disposable`
Pre-issue checklist
- [X] I've searched the issue list but couldn't find the feature I want
How can Tango be improved?
The Explicit resource management proposal adds primitives for disposable pattern.
However, using it requires a polyfill as browser support is not good now.
Symbol.dispose
and Symbol.asyncDispose
can be easily polyfilled, but not for DisposableStack
. I also don't like https://github.com/es-shims/DisposableStack, I don't need a ES3 compatible polyfill with millions of dependencies.
How should the API change?
Add our own polyfills, and refactor disposables to use those primitives.
(Optional) Other information
No response