TS typedefs: take(array) does not work with heterogenous redux-action actions
See original GitHub issueWas on 0.16 and tried the 1.0.0, and I’m getting this TS error when trying to mix redux-action actions with distinct payload types:
It works fine if the payload has same type:
It used to work fine on 0.16
Didn’t try but afaik a workaround is using toString:
Not sure how to fix this, but StringableActionCreator<any>
does work in ActionSubPattern
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Why is Array.indexOf() working correctly with one redux action ...
string mathes one of the array items, but the indexOf() function still returns -1. It doesn't match one of the array items as...
Read more >TypeScript action types from slice #771 - reduxjs/redux-toolkit
Hi, I seem to be searching for the wrong terms, is there some better way to get action types from a slice instead...
Read more >createAction - Redux Toolkit
The createAction helper combines these two declarations into one. It takes an action type and returns an action creator for that type.
Read more >Better Redux Reducers with TypeScript Builders
Redux is a great state management library, but its types are too broad. Using the builder pattern, we can generate exact types and...
Read more >Manage Lists of Objects in Redux Apps | egghead.io
Redux does not work well with non-JSON data formats. So you've got strings, booleans, numbers and arrays and basic objects.
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 Free
Top 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
Pretty busy right now, but this issue is on my list.
Hi @aikoven and thanks for your update
migrating to 1.0 is not in my priority anymore and don’t have much time, so let’s consider it’s working and if I don’t reopen later or someone else, then it’s fine 😉