Skip to content

Commit

Permalink
Rename DefaultMemoizeOptions to LruMemoizeOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Dec 1, 2023
1 parent 8e81ed0 commit eada422
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/defaultMemoize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function createCacheKeyComparator(equalityCheck: EqualityFn) {
/**
* @public
*/
export interface DefaultMemoizeOptions<T = any> {
export interface LruMemoizeOptions<Result = any> {
/**
* Used to compare the individual arguments of the provided calculation function.
*
Expand All @@ -142,7 +142,7 @@ export interface DefaultMemoizeOptions<T = any> {
* use case, where an update to another field in the original data causes a recalculation
* due to changed references, but the output is still effectively the same.
*/
resultEqualityCheck?: EqualityFn<T>
resultEqualityCheck?: EqualityFn<Result>
/**
* The cache size for the selector. If greater than 1, the selector will use an LRU cache internally.
*
Expand All @@ -161,13 +161,13 @@ export interface DefaultMemoizeOptions<T = any> {
*
* @template Func - The type of the function that is memoized.
*
* @see {@link https://github.com/reduxjs/reselect#defaultmemoizefunc-equalitycheckoroptions--defaultequalitycheck defaultMemoize}
* @see {@link https://github.com/reduxjs/reselect#lrumemoizefunc-equalitycheckoroptions--defaultequalitycheck lruMemoize}
*
* @public
*/
export function lruMemoize<Func extends AnyFunction>(
func: Func,
equalityCheckOrOptions?: EqualityFn | DefaultMemoizeOptions<ReturnType<Func>>
equalityCheckOrOptions?: EqualityFn | LruMemoizeOptions<ReturnType<Func>>
) {
const providedOptions =
typeof equalityCheckOrOptions === 'object'
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type {
TypedStructuredSelectorCreator
} from './createStructuredSelector'
export { defaultEqualityCheck, lruMemoize } from './defaultMemoize'
export type { DefaultMemoizeOptions } from './defaultMemoize'
export type { LruMemoizeOptions } from './defaultMemoize'
export { setGlobalDevModeChecks } from './devModeChecks/setGlobalDevModeChecks'
export type {
Combiner,
Expand Down

0 comments on commit eada422

Please sign in to comment.