Skip to content

Instantly share code, notes, and snippets.

@marshallmurphy
Created June 9, 2020 20:22
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 marshallmurphy/52d9409cd16058f1ae0a8af18c5ec955 to your computer and use it in GitHub Desktop.
Save marshallmurphy/52d9409cd16058f1ae0a8af18c5ec955 to your computer and use it in GitHub Desktop.
// 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