-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suport for WeakRef / FinalizationGroup #32393
Comments
Generally we don't provide polyfills, just definitions. Since there's no definition here, the only thing that should happen is a lib update |
* Add definitions for WeakRef and FinalizationRegistry Fixes #32393 * Mark callback parameter in FinalizationRegistry#cleanupSome() as optional * Make FinalizationRegistry.prototype.cleanupSome optional * Remove FinalizationRegistry.prototype.cleanupSome() Co-authored-by: Nathan Shively-Sanders <[email protected]>
This is closed but |
Can somebody please look into what @kitsonk mentioned? Both |
As of Jan 2021, WeakRef is now supported in Chrome, Firefox and Edge. Typescript is still missing WeakRef. Can we please reopen this issue? |
@AgarwalPragy it is in TypeScript 4.1 and later: https://www.typescriptlang.org/play?target=99&ts=4.1.3#code/OoUwhg1gSiBmDcAoIA so the issue doesn't need to be re-opened. |
Search Terms
stage 3, tc39, weakref, finalization group
Suggestion
WeakRef and FinalizationGroup are Stage 3 https://github.com/tc39/proposal-weakrefs
Only drawback I could think of is that, implementing a polyfill would make it over engineered and less performant than the real thing (of course), and actually leak memory if not careful.
Use Cases
Key/value cache are a great example (as stated in the proposal itself)
Examples
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: