Redux - sebihanudocs/react GitHub Wiki

computing-derived-data

https://redux.js.org/recipes/computing-derived-data#sharing-selectors-across-multiple-components

If the mapStateToProps argument supplied to connect returns a function instead of an object, it will be used to create an individual mapStateToProps function for each instance of the container.

reselect-immutable-helpers package

https://blog.isquaredsoftware.com/2017/12/idiomatic-redux-using-reselect-selectors/

keep your store state minimal, and derive data from the state as needed.

Reselect

  • provides a function **createSelector **for creating memoized selectors. createSelector takes an array of input-selectors and a transform function as its arguments.

Composing Selectors - A memoized selector can itself be an input-selector to another memoized selector.

https://github.com/toomuchdesign/re-reselect - lightweight wrapper around Reselect meant to enhance selectors with deeper memoization and cache management.


https://medium.freecodecamp.org/optimising-the-state-shape-of-your-react-app-with-redux-3a280e6ef436

  • it is best to write your selectors in the same file as your reducer
  • Replace arrays by objects