4 ms·
It might be nice to implement go's defer here too (e.g. for closing the channel) to keep some of the DX. I guess a JavaScript defer could just be enqueueMicrot
by mattlondon 3y ago
It might be nice to implement go's defer here too (e.g. for closing the channel) to keep some of the DX.
I guess a JavaScript defer could just be enqueueMicrotask and an anonymous arrow function?
- joeycumines 3y agoIf you want it to run on exiting the function in reverse order, something like Python's context managers would probably be necessary. I've dabbled in that too, though I don't actually use it for anything, currently: https://github.com/Mcsavvy/contextlib/pull/1 https://github.com/Mcsavvy/contextlib/pull/1