code4romania / czl-web

An awesome and responsive Web UI for Ce Zice Legea
http://cezicelegea.ro/
Mozilla Public License 2.0
2 stars 2 forks source link

Feature/state management #3

Closed SergiuB closed 6 years ago

SergiuB commented 6 years ago

As the app will grow, it will surely need some state management system, so it's good to start with one if we know we will need it, because it will be difficult to introduce it later.

The choice is Redux, maybe too boiler-platy for some, but battle tested.

The structure is to have reducer.js and actions.js in each top level module (the directories under src such as categories).
A root reducer, currently placed in index.js where the store is also created, will compose them.
Each top-level module exports the reducer and actions from its index.js file.