Skip to content

Instantly share code, notes, and snippets.

@peterbsmyth
Created August 1, 2016 22:57
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 peterbsmyth/56cf981ae4d18f8e007ad81dcb67cca0 to your computer and use it in GitHub Desktop.
Save peterbsmyth/56cf981ae4d18f8e007ad81dcb67cca0 to your computer and use it in GitHub Desktop.
fetch("https://fcctop100.herokuapp.com/api/fccusers/top/recent")
.then(response => {
return response.json().then(json => ({ json, response }))
}).then(({ json, response }) => {
if (!response.ok) {
return Promise.reject(json);
}
// Do Stuff with JSON HERE
// for example...
// console.log(json);
return;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment