4 ms·
Yep, this merges countless of way to dispose a resource into a single interface. Like what promise did to callback functions. (And promise almost take over plai
by mmis1000 3y ago
Yep, this merges countless of way to dispose a resource into a single interface.
Like what promise did to callback functions. (And promise almost take over plain callback these days)
Even you don't use the 'using' sugar. You may still be benefited from it if you need to implement some sort of resource management someday.
Instead of write a tear down function for every single type of resource in your code. Probably everyone will just agree upon that `Object[Symbol.dispose]()` will free this resource. And you only need to do it once and for all.