Created
May 13, 2019 19:43
-
-
Save kerminz/66db838fb4f77b91f55be55128edd7cb to your computer and use it in GitHub Desktop.
Fetch data clientside with promises
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 url = 'http://api.fetchurl.com' | |
fetch(url).then((response) => { | |
response.json().then((data) => { | |
console.log(data) | |
}) | |
}) | |
// expected output: JSON Object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment