[reselect] InputSelector is not an object error with Flow 0.92.1
See original GitHub issueUnfortunately in Flow 0.92.1, I get the following error:
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ flow-typed/npm/reselect_v3.x.x.js:11:7
InputSelector [1] is not an object.
8│ (state: TState, props: TProps, ...rest: any[]) => TResult
9│
10│ declare type OutputSelector<-TState, TProps, TResult> =
[1] 11│ & InputSelector<TState, TProps, TResult>
12│ & {
13│ recomputations(): number,
14│ resetRecomputations(): number,
Found 1 error
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Reselect: createSelector not working correctly - Stack Overflow
When I dispatch an update with "adapter.updateOne", the standard selector "SelectAll" every time (i think) changes ref. Yes, you are right.
Read more >Common Reselect Gotchas | Blog - Mastercard Developers
Reselect is a memoization library often used with Redux . ... memoize the result of the output function if the results of the...
Read more >Building Efficient Reselect Selectors | Aug, 2020 - Medium
A walkthrough of common mistakes to avoid in your selectors, as well as some best practices to ensure they compute only when necessary....
Read more >reselect - npm
A selector is not recomputed unless one of its arguments changes. ... mutated in a way that causes the value of an input-selector...
Read more >Deriving Data with Selectors - Redux
You are not required to use selectors for all state lookups, ... A somewhat common mistake is to write an "input selector" that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello guys,
I had the same issue and I fixed it by redefining the type
OutputSelector
in the fileflow-typed/npm/reselect_v4.x.x.js
like this:The previous definition was using type intersections and I replaced that with Flow’s calleable objects. It works and as far as I understand it achieves a more accurate typing.
I don’t mind to create a PR if needed.
@augusto-altman Thanks a lot for the fix!) Do you think it should also be applied for the
reselect_v3
types? Given that issue author mentionedflow-typed/npm/reselect_v3.x.x
and that the problem nor fix do not look related to the new API in v4.If that’s correct, do you want to create a PR or do you want me to do it?
Current libdef produces this error for us (which is fixed by your PR)