Last active
January 15, 2020 02:24
-
-
Save cpv123/f2454bf55cfbcdd1e4ed41c9f44bf36f 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
useEffect(() => { | |
const fetchShops = async () => { | |
try { | |
const shops = await axios.get(process.env.GATSBY_COFFEE_SHOPS_URL) | |
setShops(shops.data.Items) | |
} catch (err) { | |
setShopsError(true) | |
} finally { | |
setShopsLoading(false) | |
} | |
} | |
fetchShops() | |
}, []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment