question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS typedefs: take(array) does not work with heterogenous redux-action actions

See original GitHub issue

Was 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:

image

It works fine if the payload has same type:

image

It used to work fine on 0.16

Didn’t try but afaik a workaround is using toString:

image

Not sure how to fix this, but StringableActionCreator<any> does work in ActionSubPattern

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
aikovencommented, Jan 31, 2019

Pretty busy right now, but this issue is on my list.

1reaction
slorbercommented, Feb 11, 2019

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 😉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found