Last active
June 11, 2017 15:11
-
-
Save patarkf/588e8b5404357307fde7d427c1c7236c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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