Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save godspeedelbow/4c6d95904ad112cb0b830538af74dc84 to your computer and use it in GitHub Desktop.
Save godspeedelbow/4c6d95904ad112cb0b830538af74dc84 to your computer and use it in GitHub Desktop.
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