Skip to content

Instantly share code, notes, and snippets.

@musukvl
Created October 15, 2018 07:33
Show Gist options
  • Select an option

  • Save musukvl/e07ba43528f3fcda94413430a2305b53 to your computer and use it in GitHub Desktop.

Select an option

Save musukvl/e07ba43528f3fcda94413430a2305b53 to your computer and use it in GitHub Desktop.
Node.js db access parallelism sample
async function getUserProfile(userId) {
let [user, groups] = await Promise.all([
db.getUser(userId),
db.getUserGroups(userId)
]);
return {userId, user, groups};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment