New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strong typecheck for take*, throttle and debounce effects when action… #1984
base: main
Are you sure you want to change the base?
Conversation
… type is provided
🦋 Changeset is good to goLatest commit: 96b1334 We got this. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
… type is provided
…into Issue#1543
I'm not a TS expert so I might be wrong in what I am going to say - let's discuss this. While it's not possible right now (i think), but assuming it would be, would support for this solve your issue?
|
Presented line of code has several parts related to typing
|
Could you explain to me what it brings exactly for users? Especially for i.e. cc @aikoven @gilbsgilbs - would love you take a look at this as well |
Proposed change solve following problem.
Above code creates interface So when we're going to use effect we can strictly type it like below
We've provided exact type for This is all it did. And it is not related to |
Please bear with my questions as I just want to understand this to get a better picture of all possible implications. I still don't quite get why this would be needed for What I currently see in it is this: acceptString<'foo'>('foo') And this doesn't quite make sense to me. As to // { type: 'FOO', bar: 42 }
takeEvery('FOO', ac => {}) |
I'm here to clarify everything :-) For
Then I define saga like below
As type constant I can put either For
Right now, Or we may write
Here, TS will infer first type argument for |
Hi @Andarist , @aikoven @gilbsgilbs |
… type is provided
Adds strong typecheck for take, takeLatest, takeLeading, takeEvery, throttle and debounce effects if type explicitly provided. For example,