Last updated
Last updated
reselect
memoizes ("caches") previous state trees and calculations based upon the said tree. This means repeated changes and calculations are fast and efficient, providing us with a performance boost over standard useSelector
implementations.
The offers a good starting point!
There are two different kinds of selectors, simple and complex ones.
Simple selectors are just that: they take the application state and select a part of it.
If we need to, we can combine simple selectors to build more complex ones which get nested state parts with reselect
's createSelector
function. We import other selectors and pass them to the createSelector
call:
.../slice/selectors.ts
index.tsx
🎉 Good News: You don't need to write this boilerplate code by hand, the slice
generator will generate it for you. ✓