Created
June 9, 2020 20:22
-
-
Save marshallmurphy/52d9409cd16058f1ae0a8af18c5ec955 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
// slices/recipes.js | |
... | |
try { | |
const response = await fetch('https://www.themealdb.com/api/json/v1/1/search.php?s=') | |
const data = await response.json() | |
dispatch(getRecipesSuccess(data.meals)) // Here, delve one layer deeper. | |
} catch (error) { | |
dispatch(getRecipesFailure()) | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment