Skip to content

Instantly share code, notes, and snippets.

@spacesailor24
Created September 25, 2019 19:57
Show Gist options
  • Save spacesailor24/b8dbd11244ea925daad6f0427cc78f76 to your computer and use it in GitHub Desktop.
Save spacesailor24/b8dbd11244ea925daad6f0427cc78f76 to your computer and use it in GitHub Desktop.
Non Blocking Async Await Example
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