Socket
Socket
Sign inDemoInstall

reselect

Package Overview
Dependencies
Maintainers
6
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reselect - npm Package Compare versions

Comparing version 5.0.0-rc.1 to 5.0.0

144

dist/reselect.d.ts

@@ -80,5 +80,11 @@ /**

/**
* Configuration options for a memoization function utilizing `WeakMap` for
* its caching mechanism.
*
* @template Result - The type of the return value of the memoized function.
*
* @since 5.0.0
* @public
*/
interface WeakMapMemoizeOptions<T = any> {
interface WeakMapMemoizeOptions<Result = any> {
/**

@@ -92,4 +98,6 @@ * If provided, used to compare a newly generated output value against previous values in the cache.

* due to changed references, but the output is still effectively the same.
*
* @since 5.0.0
*/
resultEqualityCheck?: EqualityFn<T>;
resultEqualityCheck?: EqualityFn<Result>;
}

@@ -163,3 +171,3 @@ /**

*
* @see {@link https://github.com/reduxjs/reselect#weakmapmemoizefunc---since-500 weakMapMemoize}
* @see {@link https://reselect.js.org/api/weakMapMemoize `weakMapMemoize`}
*

@@ -221,3 +229,3 @@ * @since 5.0.0

*
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
*

@@ -409,5 +417,5 @@ * @since 5.0.0

*
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://github.com/reduxjs/reselect#inputstabilitycheck inputStabilityCheck}
* @see {@link https://github.com/reduxjs/reselect#2-per-selector-by-passing-an-inputstabilitycheck-option-directly-to-createselector per-selector-configuration}
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#inputstabilitycheck `inputStabilityCheck`}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#2-per-selector-by-passing-an-inputstabilitycheck-option-directly-to- per-selector-configuration}
*

@@ -425,5 +433,5 @@ * @since 5.0.0

*
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://github.com/reduxjs/reselect#identityfunctioncheck identityFunctionCheck}
* @see {@link https://github.com/reduxjs/reselect#2-per-selector-by-passing-an-identityfunctioncheck-option-directly-to-createselector per-selector-configuration}
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#identityfunctioncheck `identityFunctionCheck`}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#2-per-selector-by-passing-an-identityfunctioncheck-option-directly-to- per-selector-configuration}
*

@@ -762,3 +770,3 @@ * @since 5.0.0

*
* @see {@link https://github.com/reduxjs/reselect#unstable_autotrackmemoizefunc---since-500 autotrackMemoize}
* @see {@link https://reselect.js.org/api/unstable_autotrackMemoize autotrackMemoize}
*

@@ -837,3 +845,4 @@ * @since 5.0.0

/**
* Creates a selector creator function with the specified memoization function and options for customizing memoization behavior.
* Creates a selector creator function with the specified memoization function
* and options for customizing memoization behavior.
*

@@ -865,3 +874,3 @@ * @param options - An options object containing the `memoize` function responsible for memoizing the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`). It also provides additional options for customizing memoization. While the `memoize` property is mandatory, the rest are optional.

*
* @see {@link https://github.com/reduxjs/reselect#createselectorcreatormemoize--options-memoizeoptions createSelectorCreator}
* @see {@link https://reselect.js.org/api/createSelectorCreator#using-options-since-500 `createSelectorCreator`}
*

@@ -873,3 +882,4 @@ * @since 5.0.0

/**
* Creates a selector creator function with the specified memoization function and options for customizing memoization behavior.
* Creates a selector creator function with the specified memoization function
* and options for customizing memoization behavior.
*

@@ -896,3 +906,3 @@ * @param memoize - The `memoize` function responsible for memoizing the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`).

*
* @see {@link https://github.com/reduxjs/reselect#createselectorcreatormemoize--options-memoizeoptions createSelectorCreator}
* @see {@link https://reselect.js.org/api/createSelectorCreator#using-memoize-and-memoizeoptions `createSelectorCreator`}
*

@@ -907,3 +917,3 @@ * @public

*
* @see {@link https://github.com/reduxjs/reselect#createselectorinputselectors--inputselectors-resultfunc-createselectoroptions createSelector}
* @see {@link https://reselect.js.org/api/createSelector `createSelector`}
*

@@ -944,3 +954,3 @@ * @public

*
* @see {@link https://github.com/reduxjs/reselect#createstructuredselector-inputselectorsobject--selectorcreator--createselector createStructuredSelector}
* @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}
*

@@ -1020,3 +1030,3 @@ * @public

*
* @see {@link https://github.com/reduxjs/reselect#createstructuredselector-inputselectorsobject--selectorcreator--createselector createStructuredSelector}
* @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}
*/

@@ -1071,3 +1081,3 @@ <InputSelectorsObject extends SelectorsObject, MemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize, ArgsMemoizeFunction extends UnknownMemoizer = typeof weakMapMemoize>(inputSelectorsObject: InputSelectorsObject, selectorCreator?: CreateSelectorFunction<MemoizeFunction, ArgsMemoizeFunction>): OutputSelector<ObjectValuesToTuple<InputSelectorsObject>, Simplify<SelectorsMap<InputSelectorsObject>>, MemoizeFunction, ArgsMemoizeFunction> & InterruptRecursion;

*
* @see {@link https://github.com/reduxjs/reselect#createstructuredselector-inputselectorsobject--selectorcreator--createselector createStructuredSelector}
* @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}
*

@@ -1079,2 +1089,48 @@ * @public

/**
* Overrides the development mode checks settings for all selectors.
*
* Reselect performs additional checks in development mode to help identify and
* warn about potential issues in selector behavior. This function allows you to
* customize the behavior of these checks across all selectors in your application.
*
* **Note**: This setting can still be overridden per selector inside `createSelector`'s `options` object.
* See {@link https://github.com/reduxjs/reselect#2-per-selector-by-passing-an-identityfunctioncheck-option-directly-to-createselector per-selector-configuration}
* and {@linkcode CreateSelectorOptions.identityFunctionCheck identityFunctionCheck} for more details.
*
* _The development mode checks do not run in production builds._
*
* @param devModeChecks - An object specifying the desired settings for development mode checks. You can provide partial overrides. Unspecified settings will retain their current values.
*
* @example
* ```ts
* import { setGlobalDevModeChecks } from 'reselect'
* import { DevModeChecks } from '../types'
*
* // Run only the first time the selector is called. (default)
* setGlobalDevModeChecks({ inputStabilityCheck: 'once' })
*
* // Run every time the selector is called.
* setGlobalDevModeChecks({ inputStabilityCheck: 'always' })
*
* // Never run the input stability check.
* setGlobalDevModeChecks({ inputStabilityCheck: 'never' })
*
* // Run only the first time the selector is called. (default)
* setGlobalDevModeChecks({ identityFunctionCheck: 'once' })
*
* // Run every time the selector is called.
* setGlobalDevModeChecks({ identityFunctionCheck: 'always' })
*
* // Never run the identity function check.
* setGlobalDevModeChecks({ identityFunctionCheck: 'never' })
* ```
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#1-globally-through-setglobaldevmodechecks global-configuration}
*
* @since 5.0.0
* @public
*/
declare const setGlobalDevModeChecks: (devModeChecks: Partial<DevModeChecks>) => void;
/**
* Runs a simple reference equality check.

@@ -1143,3 +1199,3 @@ * What {@linkcode lruMemoize lruMemoize} uses by default.

*
* @see {@link https://github.com/reduxjs/reselect#lrumemoizefunc-equalitycheckoroptions--referenceequalitycheck lruMemoize}
* @see {@link https://reselect.js.org/api/lruMemoize `lruMemoize`}
*

@@ -1154,48 +1210,2 @@ * @public

/**
* Overrides the development mode checks settings for all selectors.
*
* Reselect performs additional checks in development mode to help identify and
* warn about potential issues in selector behavior. This function allows you to
* customize the behavior of these checks across all selectors in your application.
*
* **Note**: This setting can still be overridden per selector inside `createSelector`'s `options` object.
* See {@link https://github.com/reduxjs/reselect#2-per-selector-by-passing-an-identityfunctioncheck-option-directly-to-createselector per-selector-configuration}
* and {@linkcode CreateSelectorOptions.identityFunctionCheck identityFunctionCheck} for more details.
*
* _The development mode checks do not run in production builds._
*
* @param devModeChecks - An object specifying the desired settings for development mode checks. You can provide partial overrides. Unspecified settings will retain their current values.
*
* @example
* ```ts
* import { setGlobalDevModeChecks } from 'reselect'
import { DevModeChecks } from '../types';
*
* // Run only the first time the selector is called. (default)
* setGlobalDevModeChecks({ inputStabilityCheck: 'once' })
*
* // Run every time the selector is called.
* setGlobalDevModeChecks({ inputStabilityCheck: 'always' })
*
* // Never run the input stability check.
* setGlobalDevModeChecks({ inputStabilityCheck: 'never' })
*
* // Run only the first time the selector is called. (default)
* setGlobalDevModeChecks({ identityFunctionCheck: 'once' })
*
* // Run every time the selector is called.
* setGlobalDevModeChecks({ identityFunctionCheck: 'always' })
*
* // Never run the identity function check.
* setGlobalDevModeChecks({ identityFunctionCheck: 'never' })
* ```
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://github.com/reduxjs/reselect#1-globally-through-setglobaldevmodechecks global-configuration}
*
* @since 5.0.0
* @public
*/
declare const setGlobalDevModeChecks: (devModeChecks: Partial<DevModeChecks>) => void;
export { Combiner, CreateSelectorFunction, CreateSelectorOptions, DefaultMemoizeFields, DevModeCheckFrequency, DevModeChecks, DevModeChecksExecutionInfo, EqualityFn, ExtractMemoizerFields, GetParamsFromSelectors, GetStateFromSelectors, LruMemoizeOptions, MemoizeOptionsFromParameters, OutputSelector, OutputSelectorFields, OverrideMemoizeOptions, Selector, SelectorArray, SelectorResultArray, StructuredSelectorCreator, TypedStructuredSelectorCreator, UnknownMemoizer, createSelector, createSelectorCreator, createStructuredSelector, lruMemoize, referenceEqualityCheck, setGlobalDevModeChecks, autotrackMemoize as unstable_autotrackMemoize, weakMapMemoize };
export { Combiner, CreateSelectorFunction, CreateSelectorOptions, DefaultMemoizeFields, DevModeCheckFrequency, DevModeChecks, DevModeChecksExecutionInfo, EqualityFn, ExtractMemoizerFields, GetParamsFromSelectors, GetStateFromSelectors, LruMemoizeOptions, MemoizeOptionsFromParameters, OutputSelector, OutputSelectorFields, OverrideMemoizeOptions, Selector, SelectorArray, SelectorResultArray, StructuredSelectorCreator, TypedStructuredSelectorCreator, UnknownMemoizer, WeakMapMemoizeOptions, createSelector, createSelectorCreator, createStructuredSelector, lruMemoize, referenceEqualityCheck, setGlobalDevModeChecks, autotrackMemoize as unstable_autotrackMemoize, weakMapMemoize };
{
"name": "reselect",
"version": "5.0.0-rc.1",
"version": "5.0.0",
"description": "Selectors for Redux.",

@@ -5,0 +5,0 @@ "main": "./dist/cjs/reselect.cjs",

import { createNode, updateNode } from './proxy'
import type { Node } from './tracking'
import {
createCacheKeyComparator,
referenceEqualityCheck
} from '../lruMemoize'
import { createCacheKeyComparator, referenceEqualityCheck } from '../lruMemoize'
import type { AnyFunction, DefaultMemoizeFields, Simplify } from '../types'

@@ -68,3 +65,3 @@ import { createCache } from './autotracking'

*
* @see {@link https://github.com/reduxjs/reselect#unstable_autotrackmemoizefunc---since-500 autotrackMemoize}
* @see {@link https://reselect.js.org/api/unstable_autotrackMemoize autotrackMemoize}
*

@@ -71,0 +68,0 @@ * @since 5.0.0

@@ -145,3 +145,4 @@ import { weakMapMemoize } from './weakMapMemoize'

/**
* Creates a selector creator function with the specified memoization function and options for customizing memoization behavior.
* Creates a selector creator function with the specified memoization function
* and options for customizing memoization behavior.
*

@@ -173,3 +174,3 @@ * @param options - An options object containing the `memoize` function responsible for memoizing the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`). It also provides additional options for customizing memoization. While the `memoize` property is mandatory, the rest are optional.

*
* @see {@link https://github.com/reduxjs/reselect#createselectorcreatormemoize--options-memoizeoptions createSelectorCreator}
* @see {@link https://reselect.js.org/api/createSelectorCreator#using-options-since-500 `createSelectorCreator`}
*

@@ -197,3 +198,4 @@ * @since 5.0.0

/**
* Creates a selector creator function with the specified memoization function and options for customizing memoization behavior.
* Creates a selector creator function with the specified memoization function
* and options for customizing memoization behavior.
*

@@ -220,3 +222,3 @@ * @param memoize - The `memoize` function responsible for memoizing the `resultFunc` inside `createSelector` (e.g., `lruMemoize` or `weakMapMemoize`).

*
* @see {@link https://github.com/reduxjs/reselect#createselectorcreatormemoize--options-memoizeoptions createSelectorCreator}
* @see {@link https://reselect.js.org/api/createSelectorCreator#using-memoize-and-memoizeoptions `createSelectorCreator`}
*

@@ -440,3 +442,3 @@ * @public

*
* @see {@link https://github.com/reduxjs/reselect#createselectorinputselectors--inputselectors-resultfunc-createselectoroptions createSelector}
* @see {@link https://reselect.js.org/api/createSelector `createSelector`}
*

@@ -443,0 +445,0 @@ * @public

@@ -64,3 +64,3 @@ import { createSelector } from './createSelectorCreator'

*
* @see {@link https://github.com/reduxjs/reselect#createstructuredselector-inputselectorsobject--selectorcreator--createselector createStructuredSelector}
* @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}
*

@@ -140,3 +140,3 @@ * @public

*
* @see {@link https://github.com/reduxjs/reselect#createstructuredselector-inputselectorsobject--selectorcreator--createselector createStructuredSelector}
* @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}
*/

@@ -208,3 +208,3 @@ <

*
* @see {@link https://github.com/reduxjs/reselect#createstructuredselector-inputselectorsobject--selectorcreator--createselector createStructuredSelector}
* @see {@link https://reselect.js.org/api/createStructuredSelector `createStructuredSelector`}
*

@@ -211,0 +211,0 @@ * @public

@@ -12,2 +12,7 @@ import type { AnyFunction } from '../types'

* @param resultFunc - The result function to be checked.
*
* @see {@link https://reselect.js.org/api/development-only-stability-checks#identityfunctioncheck `identityFunctionCheck`}
*
* @since 5.0.0
* @internal
*/

@@ -14,0 +19,0 @@ export const runIdentityFunctionCheck = (resultFunc: AnyFunction) => {

@@ -11,2 +11,7 @@ import type { CreateSelectorOptions, UnknownMemoizer } from '../types'

* @param inputSelectorArgs - List of arguments being passed to the input selectors.
*
* @see {@link https://reselect.js.org/api/development-only-stability-checks/#inputstabilitycheck `inputStabilityCheck`}
*
* @since 5.0.0
* @internal
*/

@@ -13,0 +18,0 @@ export const runInputStabilityCheck = (

@@ -33,3 +33,3 @@ import type { DevModeChecks } from '../types'

* import { setGlobalDevModeChecks } from 'reselect'
import { DevModeChecks } from '../types';
* import { DevModeChecks } from '../types'
*

@@ -54,4 +54,4 @@ * // Run only the first time the selector is called. (default)

* ```
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://github.com/reduxjs/reselect#1-globally-through-setglobaldevmodechecks global-configuration}
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#1-globally-through-setglobaldevmodechecks global-configuration}
*

@@ -58,0 +58,0 @@ * @since 5.0.0

@@ -9,5 +9,5 @@ export { autotrackMemoize as unstable_autotrackMemoize } from './autotrackMemoize/autotrackMemoize'

} from './createStructuredSelector'
export { setGlobalDevModeChecks } from './devModeChecks/setGlobalDevModeChecks'
export { lruMemoize, referenceEqualityCheck } from './lruMemoize'
export type { LruMemoizeOptions } from './lruMemoize'
export { setGlobalDevModeChecks } from './devModeChecks/setGlobalDevModeChecks'
export type {

@@ -34,1 +34,2 @@ Combiner,

export { weakMapMemoize } from './weakMapMemoize'
export type { WeakMapMemoizeOptions } from './weakMapMemoize'

@@ -184,3 +184,3 @@ import type {

*
* @see {@link https://github.com/reduxjs/reselect#lrumemoizefunc-equalitycheckoroptions--referenceequalitycheck lruMemoize}
* @see {@link https://reselect.js.org/api/lruMemoize `lruMemoize`}
*

@@ -187,0 +187,0 @@ * @public

@@ -75,3 +75,3 @@ import type { MergeParameters } from './versionedTypes'

*
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
*

@@ -319,5 +319,5 @@ * @since 5.0.0

*
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://github.com/reduxjs/reselect#inputstabilitycheck inputStabilityCheck}
* @see {@link https://github.com/reduxjs/reselect#2-per-selector-by-passing-an-inputstabilitycheck-option-directly-to-createselector per-selector-configuration}
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#inputstabilitycheck `inputStabilityCheck`}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#2-per-selector-by-passing-an-inputstabilitycheck-option-directly-to- per-selector-configuration}
*

@@ -336,5 +336,5 @@ * @since 5.0.0

*
* @see {@link https://github.com/reduxjs/reselect#debugging-tools debugging-tools}
* @see {@link https://github.com/reduxjs/reselect#identityfunctioncheck identityFunctionCheck}
* @see {@link https://github.com/reduxjs/reselect#2-per-selector-by-passing-an-identityfunctioncheck-option-directly-to-createselector per-selector-configuration}
* @see {@link https://reselect.js.org/api/development-only-stability-checks Development-Only Stability Checks}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#identityfunctioncheck `identityFunctionCheck`}
* @see {@link https://reselect.js.org/api/development-only-stability-checks#2-per-selector-by-passing-an-identityfunctioncheck-option-directly-to- per-selector-configuration}
*

@@ -341,0 +341,0 @@ * @since 5.0.0

@@ -73,5 +73,11 @@ // Original source:

/**
* Configuration options for a memoization function utilizing `WeakMap` for
* its caching mechanism.
*
* @template Result - The type of the return value of the memoized function.
*
* @since 5.0.0
* @public
*/
export interface WeakMapMemoizeOptions<T = any> {
export interface WeakMapMemoizeOptions<Result = any> {
/**

@@ -85,4 +91,6 @@ * If provided, used to compare a newly generated output value against previous values in the cache.

* due to changed references, but the output is still effectively the same.
*
* @since 5.0.0
*/
resultEqualityCheck?: EqualityFn<T>
resultEqualityCheck?: EqualityFn<Result>
}

@@ -157,3 +165,3 @@

*
* @see {@link https://github.com/reduxjs/reselect#weakmapmemoizefunc---since-500 weakMapMemoize}
* @see {@link https://reselect.js.org/api/weakMapMemoize `weakMapMemoize`}
*

@@ -160,0 +168,0 @@ * @since 5.0.0

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc