Skip to content
Advertisement

Tag: es6-promise

Alternative for Promise.allSettled

I am currently using Promise.allSettled to wait for all my promises to finish(irrespective of whether they resolve or get rejected). Since my project is compliant to Node v12.3.1 I am unable to use this? What other simple alternatives can I use. Sample code: Note: Promise.allSettled is available from Node version >12.9. Adding shims is also not an option. Answer There’s

Unexpected unhandledRejection event for promise which rejection does get handled

Updated, I’ve now tried explaining the behavior I’m seeing, but it’d still be great to have an answer from a credible source about the unhandledRejection behavor. I’ve also started a discussion thread on Reddit. Why do I get an unhandledRejection event (for “error f1”) in the following code? That’s unexpected, because I handle both rejections in the finally section of

Advertisement