{"full_name":"reduxjs/reselect","owner":"reduxjs","name":"reselect","shard":"1","url":"https://github.com/reduxjs/reselect","description":"Selector library for Redux","homepage":"https://redux.js.org/reselect","topics":["memoized-selectors","redux"],"tag_pages":["redux"],"language":"TypeScript","license":"MIT","avatar":"https://avatars.githubusercontent.com/u/13142323?v=4","created_at":"2015-07-01T11:06:45Z","pushed_at":"2026-10-28T14:18:11Z","metrics":{"stars":18999,"forks":668,"watchers":158,"issues":424,"prs":369,"releases":49,"issues_open":22,"issues_closed":402,"prs_open":19,"prs_closed":128,"prs_merged":222,"discussions":20},"growth":{"day":{"stars":0,"forks":0,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[18998,18999,19000,19000,18999,18999,18999],"forks":[668,668,668,668,668,668,668],"watchers":[null,158,158,158,158,158,158],"issues_open":[null,22,22,22,22,22,22],"prs_open":[null,19,19,19,19,19,19]},"boards":{},"same_owner":[{"full_name":"reduxjs/redux","name":"redux","shard":"1","boards":{}},{"full_name":"reduxjs/redux-thunk","name":"redux-thunk","shard":"1","boards":{}}],"issues":[{"number":559,"title":"Inlining wrappers over `createSelector` causes selector args to be of `any` type","comments":12,"created_at":"2021-11-30T02:05:08Z"},{"number":376,"title":"Regression when using lodash for an unbounded cache and reselect 4.0","comments":12,"created_at":"2018-10-04T13:25:50Z"},{"number":691,"title":"Question: Why can't we support `createAsyncSelector`?","comments":11,"created_at":"2024-01-26T04:45:54Z"},{"number":670,"title":"Better call stack for selector warnings","comments":11,"created_at":"2023-12-18T08:13:47Z"},{"number":571,"title":"`createSelector` can't handle generic state","comments":6,"created_at":"2022-03-30T11:50:36Z"},{"number":544,"title":"Confusing behavior of caching mechanism in 4.1.2 for parametrized selectors","comments":6,"created_at":"2021-11-08T22:49:34Z"},{"number":666,"title":"Type loss in `createSelector` with inline function declarations passed as separate arguments","comments":4,"created_at":"2023-12-17T17:32:45Z"},{"number":728,"title":"Problem of not getting result value when using currySelector by mapping another currySelector","comments":2,"created_at":"2024-07-17T01:18:58Z"}],"discussions":[{"number":827,"title":"External selector traces for cache hits and equal-result reuse","comments":0,"category":"Show and tell","created_at":"2026-10-25T18:30:56Z"},{"number":787,"title":"v5.3.0","comments":0,"category":"General","created_at":"2026-08-22T02:35:42Z"},{"number":746,"title":"Memoizing rapidly changing state","comments":1,"category":"Q&A","created_at":"2025-04-10T15:17:24Z"},{"number":741,"title":"What's the correct way to return an empty array as fallback from a selector?","comments":1,"category":"Q&A","created_at":"2025-03-07T15:45:11Z"},{"number":711,"title":"What is the suggested way to migrate over to v5?","comments":1,"category":"Q&A","created_at":"2024-03-20T13:57:44Z"},{"number":662,"title":"What's the correct way of conditionally returning an input?","comments":1,"category":"Q&A","created_at":"2023-12-16T02:36:57Z"},{"number":658,"title":"v5.0.0","comments":0,"category":"General","created_at":"2023-12-04T14:00:53Z"},{"number":617,"title":"Is it safe to use createSelector in SSR?","comments":2,"category":"Q&A","created_at":"2023-06-13T09:56:25Z"}],"latest_release":{"name":"v5.3.0","tag":"v5.3.0","published_at":"2026-08-22T02:35:42Z","body":"This **feature release** adds a `maxSize` option to `weakMapMemoize` to bound cache growth, adds a new development-mode check that warns when a selector's cache grows without bound, improves memoization performance, removes the experimental `unstable_autotrackMemoize`, and updates our TypeScript support matrix and documentation.\r\n\r\n## Changelog\r\n\r\n### `maxSize` Option for `weakMapMemoize`\r\n\r\n`weakMapMemoize` has been the default memoizer since v5.0, and its main benefit is the infinite cache size.  Prior to v5, selector instances had a default cache size of 1, which meant having to create unique selector instances per component when sharing selectors that took varying arguments like IDs.  `weakMapMemoize` memoizes based on all arguments, so it eliminated the extra setup work and just stores all cached values.\r\n\r\nHowever, that behavior can also effectively turn into a memory leak depending on what state and arguments are passed in and how they're used in the UI.  \r\n\r\n `weakMapMemoize` now accepts a `maxSize` option that bounds this growth:\r\n\r\n```ts\r\nconst getVisibleItems = weakMapMemoize(\r\n  (items, from, to) => items.slice(from, to),\r\n  { maxSize: 100 }\r\n)\r\n```\r\n\r\nThis shares the same `maxSize` option name as the earlier `lruMemoize`, but has different behavior.  Rather than an LRU eviction, this is a \"generational\" swap (kind of like a double buffer).  When the cache hits its max size, it's swapped out with an empty version and starts over at 0 entries.  So, there's effectively at most 2 * `maxSize` items in memory at any time.  If `maxSize` is not enabled, there's no additional logic or performance overhead.  If you do need LRU-style behavior, use `lruMemoize` instead.\r\n\r\nNote that bounding a `createSelector` selector requires passing `maxSize` in **both** `memoizeOptions` and `argsMemoizeOptions`, since the two memoization levels have separate caches. See [the `maxSize` docs](https://reselect.js.org/api/weakMapMemoize#bounding-cache-size-with-maxsize) for details.  \r\n\r\nThanks to @veksa for proposing this in PR #761 and providing memory test infrastructure that helped verify this behavior.\r\n\r\n### New `cacheSizeCheck` Dev-Mode Check\r\n\r\nWe've also added an additional dev-mode check alongside the existing `inputStabilityCheck` and `identityFunctionCheck`.  If a memoized function has accumulated over 1000 values for the same args, it logs a warning with the function name and stack trace. By default this runs once per function.  Unlike the other two checks, it can only be configured globally, via `setGlobalDevModeChecks({ cacheSizeCheck: 'always' | 'once' | 'never' })`\r\n\r\n### Performance Improvements\r\n\r\nWe've revamped our own performance benchmark suite to give better results with more precision and less noise.  That's helped verify some additional performance improvements.\r\n\r\n- `weakMapMemoize` now returns early on a cache hit instead of continuing through bookkeeping\r\n- `lruMemoize`'s cache lookup was simplified to eliminate unnecessary allocations\r\n\r\nThese are small wins on already-fast paths, but did show modest improvements.\r\n\r\n### Removal of `unstable_autotrackMemoize`\r\n\r\nWe've removed the experimental `unstable_autotrackMemoize` export. It was added in v5.0 as an experiment in Glimmer-style dependency tracking, never left `unstable_`, and as far as we can tell never saw real adoption. If you were using it, switch to `weakMapMemoize` (the default) or `lruMemoize`.\r\n\r\n### TypeScript Support\r\n\r\nOur TypeScript support matrix is now **5.6 and up**, matching DefinitelyTyped, and CI now tests against TS 6.0. \r\n\r\nWe've documented on the selector fields that a full cache reset requires clearing both memoization levels: `selector.clearCache()` plus `selector.memoizedResultFunc.clearCache()`.\r\n\r\nWe improved types handling in cases where TS strict mode is off (but please migrate to strict behavior as soon as possible!)\r\n\r\n### Docs Improvements\r\n\r\nThe API docs got a structural overhaul: every API page now follows a consistent \"API Refe","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}