Skip to content

Instantly share code, notes, and snippets.

@patarkf
Last active June 11, 2017 15:11
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 patarkf/588e8b5404357307fde7d427c1c7236c to your computer and use it in GitHub Desktop.
Save patarkf/588e8b5404357307fde7d427c1c7236c to your computer and use it in GitHub Desktop.
const posts = [{}, {}, {}];
async function insertPostsConcurrently(posts) {
const promises = posts.map(post => db.insert(post));
const results = await Promise.all(promises);
console.log(results);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment