2 ms·
I'm a fan of grouping by cohesion for the reasons the author lays out, but like any principle you need to understand how and why you're applying it. The author
by cjcenizal 8y ago
I'm a fan of grouping by cohesion for the reasons the author lays out, but like any principle you need to understand how and why you're applying it. The author suggests grouping reducers, actions, and components by functional cohesion in a React/Redux app, but the point of grouping by layer in this case is to uncouple the layers in your app (UI vs. store vs. actions). In this situation, those layers represent the functions around which your code coheres.
- jwdunne 8y agoWe're beginning to learn and refactor towards this approach. We've already layered the app between state and UI. UI components are grouped by features. We've not done this with state but it makes sense to. But we can't see a benefit to merging state and UI layers. There are multiple UI features that make use of a set of actions and selectors.