Created
April 4, 2019 20:02
-
-
Save patmigliaccio/33242fe9e7b89288dd0e69aa219d3209 to your computer and use it in GitHub Desktop.
patmigliaccio.com/resolving-nested-promises 4/4/19
This file contains 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 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