Skip to content

Instantly share code, notes, and snippets.

@lucas-pelton
Created October 18, 2019 23:11
Show Gist options
  • Save lucas-pelton/7cb93ad6d8a3479ebe042b89cbab8606 to your computer and use it in GitHub Desktop.
Save lucas-pelton/7cb93ad6d8a3479ebe042b89cbab8606 to your computer and use it in GitHub Desktop.
"Synchronous" fetch with async/await
const request = async () => {
const response = await fetch('https://api.com/values/1');
const json = await response.json();
console.log(json);
}
request();
// https://dev.to/johnpaulada/synchronous-fetch-with-asyncawait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment