Created
May 21, 2018 09:55
-
-
Save toropanov/7827a8addff9fa109d31bb9ebb2ebee8 to your computer and use it in GitHub Desktop.
Getting awaiting promise
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
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