Created
September 8, 2020 23:31
-
-
Save texas2010/0fee92d49d38ef58c0e8556660aea58a to your computer and use it in GitHub Desktop.
This file contains 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
const getJSON = async (url) => { | |
try { | |
const response = await fetch(url) | |
return await response.json() | |
} catch (error) { | |
throw new Error('Unable to get data: ', error) | |
} | |
} | |
export { getJSON as default } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment