Created
September 25, 2019 19:57
-
-
Save spacesailor24/b8dbd11244ea925daad6f0427cc78f76 to your computer and use it in GitHub Desktop.
Non Blocking Async Await Example
This file contains hidden or 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 getValuesFromAPI = async () => { | |
const firstValue = getValueFromAPI('firstValue'); | |
const secondValue = getValueFromAPI('secondValue'); | |
const firstAndSecondValues = Promise.all([firstValue, secondValue]); | |
return firstAndSecondValue | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment