Don't map your reducers/actions to the components... map them to the data/features they are tied to. If you organize by feature, you don't really have to have your actions/dispatchers sitting with your components, but you can where it makes sense.
Just to expand... as an example...
.../features/users/login
may contain both the ui components as well as specific actions/reducers related to login... though other components may call actions under features/user as necessary, because they correlate to the data/features/functionality around users, where the components themselves may be for other features.I feel that once you stop trying to segregate by either component or type of module/script that it tends to be far easier for someone new to come up to speed in a project. It is taking practice and some thought, but has worked very well where I've implemented this approach so far.
Mobx needs more love.
For flexibility I am leaning towards making MobX as a choice in projects and then being able to build up towards an architecture like Flux in an application.
Re:A SoundCloud client in React and Redux
by lucidrains on Sunday June 12, 2016 @11:03PM
(#11891492)
Second this, mobx is awesome
Re:A SoundCloud client in React and Redux
by groovytime on Sunday June 12, 2016 @10:13PM
(#11891361)
Heaven for bid you actually have to understand how/why something works and not just have "magic" happen.
Oh sorry, I think I had something that I needed to let out :)
Anyway, recently I discovered MobX[1] which, aside from the bad name, is amazing. It's pretty flexible and has very small API surface but compared to Redux it just gets out of the way. Granted, there's a lot of hidden logic which feels like magic but in the end it allows me to build apps way faster while still producing performant code. I have moved few projects from Redux to Mobx and it's mainly removing code and files and bundling mobx stores with components. At work I been able to explain it to coworkers in two minutes where as it has taken hours or days for people to understand Redux. I highly recommend checking out the React+MobX tutorial[2] and give it a go even though it's not the hot thing of the week just yet :)
[1] https://mobxjs.github.io/mobx/ [2] https://mobxjs.github.io/mobx/getting-started.html