Skip to content

Commit

Permalink
fix: update signature for createSelectorFactory and createSelector to…
Browse files Browse the repository at this point in the history
… return a MemoizedSelector (#1883)

BREAKING CHANGE:

The return type of the createSelectorFactory and createSelector is now a MemoizedSelector instead of a Selector
  • Loading branch information
timdeschryver authored and brandonroberts committed May 22, 2019
1 parent a7ded00 commit 8b31da7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/store/src/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ export function createSelector<

export function createSelector(
...input: any[]
): Selector<any, any> | SelectorWithProps<any, any, any> {
): MemoizedSelector<any, any> | MemoizedSelectorWithProps<any, any, any> {
return createSelectorFactory(defaultMemoize)(...input);
}

Expand Down Expand Up @@ -521,18 +521,18 @@ export type SelectorFactoryConfig<T = any, V = any> = {

export function createSelectorFactory<T = any, V = any>(
memoize: MemoizeFn
): (...input: any[]) => Selector<T, V>;
): (...input: any[]) => MemoizedSelector<T, V>;
export function createSelectorFactory<T = any, V = any>(
memoize: MemoizeFn,
options: SelectorFactoryConfig<T, V>
): (...input: any[]) => Selector<T, V>;
): (...input: any[]) => MemoizedSelector<T, V>;
export function createSelectorFactory<T = any, Props = any, V = any>(
memoize: MemoizeFn
): (...input: any[]) => SelectorWithProps<T, Props, V>;
): (...input: any[]) => MemoizedSelectorWithProps<T, Props, V>;
export function createSelectorFactory<T = any, Props = any, V = any>(
memoize: MemoizeFn,
options: SelectorFactoryConfig<T, V>
): (...input: any[]) => SelectorWithProps<T, Props, V>;
): (...input: any[]) => MemoizedSelectorWithProps<T, Props, V>;
export function createSelectorFactory(
memoize: MemoizeFn,
options: SelectorFactoryConfig<any, any> = {
Expand All @@ -541,7 +541,7 @@ export function createSelectorFactory(
) {
return function(
...input: any[]
): Selector<any, any> | SelectorWithProps<any, any, any> {
): MemoizedSelector<any, any> | MemoizedSelectorWithProps<any, any, any> {
let args = input;
if (Array.isArray(args[0])) {
const [head, ...tail] = args;
Expand Down

0 comments on commit 8b31da7

Please sign in to comment.