Bringing Everything Together: Index Files
As we begin working on our app, we shall first index all our major actors into their own directories. This is a common Redux practice and will prove helpful in the future.
We'll cover the following
All important components required to build the more advanced Hello World app have been discussed in isolation in the earlier sections.
Now, let’s put everything together and build the app. Excited?
Firstly, let’s talk about folder structure.
When you get to a bank, the Cashier likely sits in their own cubicle/office. The Vault is also kept safe in a secure room. For good reasons, things feel a little more organised that way. Everyone in their own space.
The same may be said for Redux.
It is a common practice to have the major actors of a redux app live within their own folder/directory. By actors, I mean, the reducer, actions and store.
It is common to create 3 different folders within your app directory, and name it after these actors.
This isn’t a must - and inevitably, you decide how you want to structure your project. For big applications though, this is certainly a pretty decent practice.
We’ll now refactor the current app directories we have. Create a few new directories/folders. One called reducers, another, store, and the last one, actions.
You should now have a component structure that looks like this:
Get hands-on with 1200+ tech skills courses.