Created
March 2, 2017 15:09
-
-
Save godspeedelbow/4c6d95904ad112cb0b830538af74dc84 to your computer and use it in GitHub Desktop.
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 run = async userId => { | |
const [user, posts] = await Promise.all([ | |
getUser(userId), | |
getPosts(userId), | |
]); | |
const comments = await getComments(posts); | |
return await parsePostsWithComments(user, posts, comments); | |
} | |
try { | |
console.log('postsWithComments', run(userId); | |
} catch (err) { | |
console.log('err', err); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment