reselect
0.5.0, released 6 years ago by an unverified publisher
Efficiently derive memoized data from your Redux store or other state
What it does
Provides selector functions to compute derived data from a single input like a Redux store. Caches results and only recomputes when input arguments change. Allows composing multiple selectors together.
AI-written summary of version 0.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are using Redux and need to compute expensive derived data from state
- You want to keep your Redux state minimal by deriving views of data on the fly
- You need to compose multiple data selectors efficiently without unnecessary recalculations
Skip it when
- Your application is small and simple functions are enough
- You are using a state management solution that already has built-in derivation and memoization like Riverpod
Strengths
- Memoizes derived computations to prevent redundant work
- Composable selectors that can be combined like building blocks
- Customizable memoization functions for different comparison strategies
Weaknesses
- Adds an extra layer of abstraction that is unnecessary for small applications
- Geared primarily toward Redux workflows
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Not documented
final productsSelector = (AppState state) => state.products;
final onSaleSelector = createSelector1(
productsSelector,
(products) => products.where((product) => product.onSale),
);Alternatives
Packages that do the same job and could replace reselect.
- riverpod
Riverpod provides built-in state derivation and caching via providers, serving as a complete modern state management and dependency injection solution.
99Compare - flutter_riverpod
Offers built-in reactive data derivation and caching integrated directly with Flutter widgets.
93Compare
Works with
Packages commonly used together with reselect: ones it builds on, ones built on it, and its own family.