A library for creating memoized selector functions to efficiently compute derived data from immutable state, commonly used with Redux.
Reselect is a JavaScript library for creating memoized selector functions that compute derived data from state. It solves the problem of expensive recalculations in applications by caching results and only recomputing when dependencies change. While commonly used with Redux, it works with any immutable JavaScript data.
Developers building applications with Redux or any state management system that uses immutable data, particularly those needing optimized performance for derived state calculations.
Developers choose Reselect for its efficient memoization, seamless integration with Redux, and ability to maintain reference equality—key for optimizing React re-renders. Its composable design and customization options make it a robust solution for complex state derivation.
Selector library for Redux
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Selectors only recompute when input arguments change, preventing expensive recalculations as shown in the basic usage example where memoized selectors skip runs.
Selectors can be nested and used as inputs to others, enabling complex derived state logic without performance loss, highlighted in the terminology section.
Returns the same object reference when inputs haven't changed, crucial for optimizing React and Redux re-renders, demonstrated in the example with equality checks.
Supports strategies like `lruMemoize` and `weakMapMemoize` for tailored caching, introduced in version 5.0.0 for flexibility.
Includes stability checks and output selector fields for debugging input selectors and result functions, aiding in identifying issues during development.
Relies on immutable data patterns; if state is mutated, memoization can fail silently, leading to incorrect cached results without clear errors.
Version 5.0 requires TypeScript 4.7 or higher, discontinuing support for older versions and potentially forcing upgrades in legacy codebases.
Customizing memoization with `createSelectorCreator` and options objects adds complexity compared to simpler, built-in solutions in other libraries.
Adds library weight to projects, which might be unnecessary for applications with minimal derived state or where performance gains are marginal.