ya-webadb icon indicating copy to clipboard operation
ya-webadb copied to clipboard

[Suggestion] Use `Symbol.dispose` to replace our own `Disposable`

Open yume-chan opened this issue 1 month ago • 0 comments

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

yume-chan avatar May 04 '24 12:05 yume-chan