Rusty Locks Notes 2023

#Link |  Run Promises Sequentially

Uhh, this idea is good and I really need to try it out. Instead of going through an array of promises in a cumbersome way to make sure that the things run in sequence as sometimes needed, just use Array.reduce as Angelos Chalaris suggests:

const runPromisesInSeries = ps =>
  ps.reduce((p, next) => p.then(next), Promise.resolve());

30 Seconds Of Code - Run JavaScript promises in series



You can interact with this note (applause, criticism, whatever) by mention it in one of your posts or by replying to its syndication on Mastodon, which will be shown here as a Webmention .

In case your blog software can't send Webmentions, you can use this form:


No Webmentions yet...