| For a simple app your code works fine. You will have trouble when it scales. We have migrated a load of model logic from Angular to redux and redux saga, once you get your head around a nice structure then its a dream. I created a gist for you to check out [1]. Maybe also check out the concept of Redux Ducks [2]. I now find our code easy to read, share and test - unlike our massive Angular app. Also as somebody else comments, you should make sure the only way you talk to your store is through a reducer dispatcher. Regarding component states, find some reading on components v containers [3] - we even have 2 separate folders for the different types. Once mastered and implemented, most components are small and again easy to test. [1] https://gist.github.com/anonymous/a20f603f9922742bd3cea7a08c... [2] https://github.com/erikras/ducks-modular-redux [3] https://medium.com/@dan_abramov/smart-and-dumb-components-7c... |
I guess I'll need to do some more reading on how this works in larger applications with more complex model structures. Thanks for the links!