Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
3
vladimyr avatar

@postpostscript I guess you are using this inside your private vals but the good news is that you don't need to roll your own implementation! It became a standard thing: Promise.withResolvers().

Checkout out an example: https://www.val.town/v/vladimyr/promiseWithResolvers_example

postpostscript avatar

@vladimyr ahh I was sure I saw something like this somewhere, thanks!

vladimyr avatar

Honestly, I'm amazed how quickly it went through all TC39 proposal stages. The whole thing started last February: https://github.com/tc39/proposal-promise-with-resolvers/commit/c89fa6b 😮

Updated: April 10, 2024