Created
October 18, 2019 23:11
-
-
Save lucas-pelton/7cb93ad6d8a3479ebe042b89cbab8606 to your computer and use it in GitHub Desktop.
"Synchronous" fetch with async/await
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
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