Created
August 1, 2016 22:57
-
-
Save peterbsmyth/56cf981ae4d18f8e007ad81dcb67cca0 to your computer and use it in GitHub Desktop.
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
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