Skip to content

Commit

Permalink
Use Callable Type Signature for Memoize Callback in createSelectorCre…
Browse files Browse the repository at this point in the history
…ator

Addresses issue #20007 by adding a callable type signature for the memoize callback in createSelectorCreator. This avoids a type error when using Lodash Memoize as the first argument in createSelectorCreator
  • Loading branch information
micahbales committed Jul 30, 2020
1 parent 0c25739 commit 4987a6b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,30 +962,30 @@ export function createSelector<S, P, R, T>(
combiner: (...res: R[]) => T,
): OutputParametricSelector<S, P, T, (...res: R[]) => T>;

export function defaultMemoize<F extends Function>(
export function defaultMemoize<F extends (...args: any[]) => any>(
func: F, equalityCheck?: <T>(a: T, b: T, index: number) => boolean,
): F;

export function createSelectorCreator(
memoize: <F extends Function>(func: F) => F,
memoize: <F extends (...args: any[]) => any>(func: F) => F,
): typeof createSelector;

export function createSelectorCreator<O1>(
memoize: <F extends Function>(func: F,
memoize: <F extends (...args: any[]) => any>(func: F,
option1: O1) => F,
option1: O1,
): typeof createSelector;

export function createSelectorCreator<O1, O2>(
memoize: <F extends Function>(func: F,
memoize: <F extends (...args: any[]) => any>(func: F,
option1: O1,
option2: O2) => F,
option1: O1,
option2: O2,
): typeof createSelector;

export function createSelectorCreator<O1, O2, O3>(
memoize: <F extends Function>(func: F,
memoize: <F extends (...args: any[]) => any>(func: F,
option1: O1,
option2: O2,
option3: O3,
Expand Down

0 comments on commit 4987a6b

Please sign in to comment.