
Reselect
A library for creating memoized selector functions that derive data from state, mainly for Redux.
- Stars
- 19k
- Forks
- 666
- Licence
- MIT
- Language
- TypeScript
- Last update
- 8 days ago
- Type
- Library
What it is
Reselect helps you write functions that pull or compute data from an app's state. It remembers the last result and only recalculates when the inputs change, which avoids repeated work. It is commonly used with Redux, though the README says it works with any plain JavaScript immutable data.
- Filtering a list of todos to show only completed items without recalculating on unrelated state changes
- Combining several input selectors into one derived value, such as a count of unread alerts
- Building structured selectors that return several derived values at once with createStructuredSelector
Great for
- Redux users who want to derive data from a minimal store without recomputing it on every render
- Developers using React-Redux who need stable result references to avoid unnecessary UI updates
- TypeScript projects that want typed, composable selectors
Not ideal for
- People who are not using Redux or immutable-style data, since the main benefit depends on unchanged inputs
- Beginners new to Redux, who may find the memoization concepts hard to grasp without learning the Redux basics first
How to get it
- 1
Install with a package manager
You'll need: Node.js · npm, yarn, or pnpm
Install with npm
npm install reselectInstall with Yarn
yarn add reselectInstall with pnpm
pnpm add reselect - 2
Run it
- Install the reselect package, or import createSelector from @reduxjs/toolkit if you already use Redux Toolkit
- Import createSelector from 'reselect'
- Define one or more input selectors that read from your state
- Pass the input selectors and a result function to createSelector and call the returned selector
- 3
Get the most out of it
- Use the official docs at reselect.js.org for the API reference on createSelector, createSelectorCreator, and createStructuredSelector
- Enable development-only checks such as inputStabilityCheck and identityFunctionCheck to catch selector mistakes, as described in the v5.0.0 notes
- Read the Redux docs page on deriving data with selectors for usage patterns and React-Redux guidance
- Use createSelectorCreator with custom memoize or argsMemoize options if the default caching does not fit your needs
Downloads
Strengths
- Selectors skip recalculation when their arguments have not changed, according to the README
- Returns the same result reference when nothing changed, which helps React-based UI updates
- Composable: selectors can be used as inputs to other selectors
Trade-offs
- Only useful when the data it wraps is treated as immutable; mutated state will not be detected
- Requires understanding memoization and selector composition, which adds conceptual overhead
- The README is truncated here, so version compatibility details beyond the v5 notes are not covered
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| reselect (this) | 19k | Library | intermediate | 8 days ago | Redux users who want to derive data from a minimal store without recomputing it on every render |
| redux-toolkit | 11.2k | Library | intermediate | 4 days ago | Developers already using or learning Redux for app state |
| redux | 61.4k | Library | intermediate | 16 days ago | Developers building larger front-end apps where many components share the same data |
| zustand | 58.9k | Library | beginner | 15 days ago | React developers who want simpler shared state than Redux |
| immer | 29k | Library | beginner | 5 days ago | JavaScript developers who find hand-written immutable updates verbose or error-prone |
| redux-saga | 22.4k | Library | intermediate | 11 days ago | React or other frontend developers already using Redux who need to manage async logic |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.