Search⌘ K
AI Features

Adding Ingredients

Understand how to modify Redux reducers to handle adding ingredients and use action creators to dispatch actions efficiently. Learn to manage state updates clearly and test changes within your Redux store.

We'll cover the following...

Similar to adding recipes, this step will require us to modify the reducer again to add support for adding ingredients:

const reducer = (state, action) => {
  switch (action.type) {
    case 'ADD_RECIPE':
      return Object.assign({}, state, {
        recipes: state.recipes.concat({ name: action.name })
      });

    case
...