Skip to content

Instantly share code, notes, and snippets.

@kerminz
Created May 13, 2019 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerminz/66db838fb4f77b91f55be55128edd7cb to your computer and use it in GitHub Desktop.
Save kerminz/66db838fb4f77b91f55be55128edd7cb to your computer and use it in GitHub Desktop.
Fetch data clientside with promises
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