You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there are incorrect types for the resultFunc property that you can pull off of a created selector. I am on version 4.1.7
functionisOdd(num: number): boolean{returnnum%2===1;}constmemoizedIsOdd=createSelector([isOdd],(bool: boolean)=>bool);memoizedIsOdd.resultFunc(true).clearCache();//doesn't exist, but the types think it does
clearCache is only on the actual selector returned by createSelector, not the return value of result func. The types think it's on both though.
node output:
Welcome to Node.js v16.18.1.
Type ".help" for more information.
> function isOdd(num) {
... return num % 2 === 1;
... }
undefined
>
> const { createSelector } = require('reselect')
undefined
> createSelector
[Function: createSelector]
> const memoizedIsOdd = createSelector([isOdd], (bool) => bool);
undefined
> memoizedIsOdd.resultFunc.clearCache
undefined
> memoizedIsOdd.clearCache
[Function (anonymous)]
> memoizedIsOdd.resultFunc(true)
true
> memoizedIsOdd.resultFunc(true).clearCache
undefined
> memoizedIsOdd.resultFunc(true).clearCache()
Uncaught TypeError: memoizedIsOdd.resultFunc(...).clearCache is not a function
>
The text was updated successfully, but these errors were encountered:
I think there are incorrect types for the
resultFunc
property that you can pull off of a created selector. I am on version 4.1.7clearCache is only on the actual selector returned by createSelector, not the return value of result func. The types think it's on both though.
node output:
The text was updated successfully, but these errors were encountered: