Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save toropanov/7827a8addff9fa109d31bb9ebb2ebee8 to your computer and use it in GitHub Desktop.
Save toropanov/7827a8addff9fa109d31bb9ebb2ebee8 to your computer and use it in GitHub Desktop.
Getting awaiting promise
function getFullPost(){
return await Promise.all([
fetch('/post'),
fetch('/comments')
]);
}
const [post, comments] = await getFullPost();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment