Skip to content

Instantly share code, notes, and snippets.

@samzhao
Created June 30, 2018 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samzhao/463c9322d672b536633d247f34b91b8b to your computer and use it in GitHub Desktop.
Save samzhao/463c9322d672b536633d247f34b91b8b to your computer and use it in GitHub Desktop.
Delayed map helper
const delayedMap = async (list, iterator, delayTime) => {
let promises = [];
for (const item of list) {
await delay(delayTime);
promises.push(await iterator(item));
}
return Promise.all(promises);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment