With the adjustments of the last lectures, we got leaner reducer files. Generally, we split our actions
and reducers across a lot of files and created a lot of boilerplate code here. For a small project as this
one,
this is clearly overkill but also it allows me to show you what you can do and that will become important
as you build bigger applications.
We'll already see some advantages in the burger builder app which we'll work on in the next course module
again.
I wanted to highlight these possible improvements or restructurings to allow you to write as lean and
understandable reducers actions and react applications in general as possible.
Now one other thing I want to quickly dive into is an alternative folder structure,
now the folder structure really is something you can find styles of different approaches,
the approach I chose in this course is the one you'll probably see the most often in react projects,
it's quite good with the containers and components differentiation and then the store.
Now as your store grows, you might add more and more action and reducer files and you'll notice that
some of your reducer files refer to some container and other reducer files to another container.
For that reason, in an alternative project structure, you could create a store subfolder in every container
and then only add the reducer and the actions for that given container to that store.
And if you had more containers, each container folder had a store folder, you wouldn't have that global
store folder and you would have a lot of actions and reducers for each container which you then still
combine together in your index.js file though.
So this is an alternative,
you can also mix that with a global store for some global or shared operations you might need everywhere,
that really is something you can fine tune and where you can read a lot of articles with a lot of opinions.
Find the approach you like, for many projects,
the approach shown here with a central store folder should be fine
but be aware that you're free to deviate from that when needed.