Skip to content

Instantly share code, notes, and snippets.

@kentcdodds
Forked from ryanflorence/gist:927ef8266fdd5525bf8e
Last active January 8, 2016 19:26
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 kentcdodds/783574f7b5a5cf7e5c55 to your computer and use it in GitHub Desktop.
Save kentcdodds/783574f7b5a5cf7e5c55 to your computer and use it in GitHub Desktop.
function fetchJSON(options, cb) {
fetch(options).
then(res => res.json()).
then(json => cb(null, json)).
catch(err => cb(err))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment