Introduction
Explore how to structure and manage application state in Redux by building a recipe book app. Understand different approaches to storing nested data in the store and learn why a flat and normalized state structure improves code clarity. Gain practical insight into linking state data and using reducers effectively.
We'll cover the following...
To illustrate how to use different parts of Redux, we will be building a recipe book application.
It will add recipes and ingredients for each recipe and fetch an initial recipe list from a remote server.
The first step with any Redux-based app is to plan how data will be arranged in the store. Our recipe object will start out holding only the recipe’s name. To store the current list, we can use a regular array:
recipes = [
{ name: 'Omelette' },
...
];
Ingredients for each ...