Guest User

Untitled

a guest
Oct 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. const getJSON = (input, init) => {
  2. return fetch(input, init)
  3. .then((response) => response.ok
  4. ? response
  5. : Promise.reject(
  6. new Error(`${response.status}: ${response.statusText}`)
  7. )
  8. )
  9. .then((response) => response.json());
  10. }
Add Comment
Please, Sign In to add comment