...

/

Structuring the Code

Structuring the Code

Learn how to structure your code.

We'll cover the following...

Having all our code in a single file is a bad idea. In Redux, it’s common for the directory structure to follow the names of the Redux “actors.” Reducers are placed in the reducers directory in the root.js file along with the main reducer (commonly called the root reducer). Action creators go in the actions directory, divided by the type of object or data they handle. Our action creators are actions/recipes.js and actions/ingredients.js.

Actions

First, we will create the actions directory. Inside of ...