Skip to content

Instantly share code, notes, and snippets.

@patmigliaccio
Created April 4, 2019 20:02
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 patmigliaccio/33242fe9e7b89288dd0e69aa219d3209 to your computer and use it in GitHub Desktop.
Save patmigliaccio/33242fe9e7b89288dd0e69aa219d3209 to your computer and use it in GitHub Desktop.
patmigliaccio.com/resolving-nested-promises 4/4/19
const activeUsers = await post.getActiveUsers();
const activeUsersComments = activeUsers.map(user => {
user.comments = user.commentIds.map(async commentId => {
return await comments.getCommentById(commentId)
});
return user;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment