Selector Functions: An API for Accessing Redux State

InstructorJamund Ferguson

Share this video with your friends

Send Tweet

As our data becomes spread out across multiple reducers, it becomes important standardize how we access that data. Ultimately each “slice” of your redux store owns how that data is named or stored and it’s convenient to provide selector functions as a public interface to that data.

More about this technique can be found in the redux style guide: https://redux.js.org/style-guide/style-guide#use-selector-functions-to-read-from-store-state

It's also strongly recommended that you cache/memoize your selectors, especially as they get more complex. A common library to help with that pattern is reselect but we do not cover it in this lesson.