Reselect provides memoized selector functions to derive data from application state efficiently. It is commonly used with Redux but works with any immutable JavaScript data.
Overview
Reselect is a library for building memoized selector functions. Selectors compute derived values from inputs such as Redux store state, re-running only when an argument changes. That pattern helps keep stored state minimal while still answering UI and logic questions from composed data.
The createSelector API accepts one or more input selectors plus a result function. Input selectors extract values from arguments; the result function combines those values into a derived result. Output selectors skip work when inputs are unchanged and can return the previous result reference when nothing changed, which matters for consumers that compare references.
Selectors compose: output selectors of one createSelector call can feed another. The library ships with related helpers such as createSelectorCreator, createStructuredSelector, lruMemoize, and weakMapMemoize. Recent releases add optional development checks, customizable memoization, and stronger TypeScript ergonomics for nested selectors.
Redux Toolkit bundles Reselect by default; standalone installs use the reselect package. Documentation covers usage with React-Redux and general patterns for deriving data from state without redundant recomputation.
Key features
- createSelector memoized selectors
- Composable input and result functions
- Reference-stable outputs when unchanged
- createStructuredSelector helper
- Customizable memoize functions
- Bundled in Redux Toolkit
- TypeScript-oriented API
- Development stability checks
Use cases
- Deriving Redux view data
- Avoiding redundant list filtering
- Composing multi-step state projections
- Sharing derived data across components