Angular · Senior · Question 37 of 75
Why are NgRx selectors created with createSelector memoized?
- ✓Correct answer: They return the same result reference until their inputs change, avoiding needless recalculation and re-rendering
- 2Memoization encrypts the state
- 3It lets selectors modify state
Explanation
Selectors compose (selectVisibleTodos from selectTodos and selectFilter) and only recompute when an input slice changes, which keeps OnPush components efficient.