2 ms·
Small hint, JavaScript is in the process of getting a dispose like API, already at stage 3. https://github.com/tc39/proposal-explicit-resource-management https
by pjmlp 2y ago
Small hint, JavaScript is in the process of getting a dispose like API, already at stage 3.
https://github.com/tc39/proposal-explicit-resource-management https://github.com/tc39/proposal-explicit-resource-managemen...
- icar 2y agoGood read about this if you are using Typescript and want to start using it now (pun inteded): https://www.totaltypescript.com/typescript-5-2-new-keyword-using https://www.totaltypescript.com/typescript-5-2-new-keyword-u...
- bakkoting 2y agoNote that the new disposable protocol in JavaScript is unrelated to garbage collection; it's more like Go's `defer`. The grandparent is talking about JavaScript's somewhat older FinalizationRegistry.
- pjmlp 2y agoSure, just like in many other languages with automatic memory management.