State Management · Junior · Question 56 of 75

Why define selector functions like selectCartTotal(state) instead of inline lookups everywhere?

Explanation

When the state structure changes, only the selectors need updating. createSelector adds memoization for derived data.

Further reading

Problem with a question

State Management · Junior · question 56

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz