Skip to content

Commit

Permalink
Update selector.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
david-shortman committed Feb 3, 2021
1 parent 8245237 commit c560e68
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions modules/store/src/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,30 @@ export function createSelector<S extends Selector<any, any>[], Result>(
(...args: [...{ [i in keyof S]: ValueOfSelector<S[i]> }]) => Result
]
): MemoizedSelector<StateOfSelectors<S>, Result>;
export function createSelector<
S extends SelectorWithProps<any, any, any>[],
Props,
Result
>(
...args: [
...S,
(...args: [...{ [i in keyof S]: ValueOfSelector<S[i]> }, Props]) => Result
]
): MemoizedSelectorWithProps<StateOfSelectors<S>, Props, Result>;
export function createSelector<S extends Selector<any, any>[], Result>(
selectors: S,
projector: (...args: [...{ [i in keyof S]: ValueOfSelector<S[i]> }]) => Result
): MemoizedSelector<StateOfSelectors<S>, Result>;
export function createSelector<
S extends SelectorWithProps<any, any, any>[],
S extends MemoizedSelectorWithProps<any, any, any>[],
Props,
Result
>(
selectors: S,
projector: (...args: [...{ [i in keyof S]: ValueOfSelector<S[i]> }]) => Result
): MemoizedSelectorWithProps<StateOfSelectors<S>, PropsOfSelectors<S>, Result>;
export function createSelector<S extends Selector<any, any>[], Result>(
...args: [
...S,
(...args: [...{ [i in keyof S]: ValueOfSelector<S[i]> }]) => Result
]
): MemoizedSelectorWithProps<StateOfSelectors<S>, PropsOfSelectors<S>, Result>;
projector: (
...args: [...{ [i in keyof S]: ValueOfSelector<S[i]> }, Props]
) => Result
): MemoizedSelectorWithProps<StateOfSelectors<S>, Props, Result>;

export function createSelector(
...input: any[]
Expand Down

0 comments on commit c560e68

Please sign in to comment.