I wrote 6 short articles about better ways to write your Redux code. Hope you find it useful!
https://medium.com/@adamklein_66511/redux-bad-practices-1-lists-as-arrays-9115ba87b0ce
In a Redux store, you may have both data from the server, together with the UI-related state. For example, you can have a list of products from the server, and save which one of those the user has selected using a checkbox.
Consider the following code:
mapStateToProps = (state) => ({ currentUser: { id: state.currentUserId, role: state.currentRole }})
Let’s say you need to display a filtered list of products.
One approach would be to save the filtered list on each filter change in a component’s state or in a different key in a Redux store:
Complex applications usually deal with data structures that have associations, e.g. posts that have comments.
You might save the data nested in the state:
posts: id: 1 title: 'Better Redux' comments: id…