Hello,
The definition file has the createSelector with a maximum of 12 selectors.
For people who need more than 12, it does not work. Do you have any guidance? Thank you
I recommend creating a wrapper component with it's own selector that wraps the child component. Then passing up to 12 props down to the child component that would otherwise need more than 12 selectors. This approach gives you up to 24 selectors, personally I have never needed more than that with the code base I'm working with.
Ran into this issue too. Typescript 3.0 supports expanding parameters. Might be it is possible? https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/
// TODO (billg): 5 overloads should *probably* be enough for anybody?
function call<T1, T2, T3, T4, R>(fn: (param1: T1, param2: T2, param3: T3, param4: T4) => R, param1: T1, param2: T2, param3: T3, param4: T4): R
function call<T1, T2, T3, R>(fn: (param1: T1, param2: T2, param3: T3) => R, param1: T1, param2: T2, param3: T3): R
function call<T1, T2, R>(fn: (param1: T1, param2: T2) => R, param1: T1, param2: T2): R
function call<T1, R>(fn: (param1: T1) => R, param1: T1): R;
function call<R>(fn: () => R, param1: T1): R;
function call(fn: (...args: any[]) => any, ...args: any[]) {
return fn(...args);
}
With spreading parameter list:
function call<TS extends any[], R>(fn: (...args: TS) => R, ...args: TS): R {
return fn(...args);
}
@prabirshrestha Exactly that is currently being discussed here:
https://github.com/reduxjs/reselect/issues/340
https://github.com/reduxjs/reselect/issues/366
https://github.com/reduxjs/reselect/issues/351
Most helpful comment
Ran into this issue too. Typescript 3.0 supports expanding parameters. Might be it is possible? https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/
With spreading parameter list: