Redux Fundamentals, Part 7: Standard Redux Patterns

  • Action creator functions encapsulate preparing action objects and thunks
    • Action creators can accept arguments and contain setup logic, and return the final action object or thunk function
  • Memoized selectors help improve Redux app performance
    • Reselect has a createSelector API that generates memoized selectors
    • Memoized selectors return the same result reference if given the same inputs
  • Request status should be stored as an enum, not booleans
    • Using enums like 'idle' and 'loading' helps track status consistently
  • “Flux Standard Actions” are the common convention for organizing action objects
    • Actions use payload for data, meta for extra descriptions, and error for errors
  • Normalized state makes it easier to find items by ID
    • Normalized data is stored in objects instead of arrays, with item IDs as keys
  • Thunks can return promises from dispatch
    • Components can wait for async thunks to complete, then do more work

References
https://redux.js.org/tutorials/fundamentals/part-7-standard-patterns