-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update TypeScript typings for v1.0 #1255
Conversation
…l`, `apply`, `cps` etc
…tors to infer action type in `takeEvery` etc.
export interface RunSagaOptions<A, S> { | ||
context?: object; | ||
subscribe?: Subscribe<A>; | ||
channel?: PredicateTakeableChannel<A>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While technically this is correct, because saga will allow for it - the best option is to pass stdChannel
here, maybe typings could enforce it? Dunno what best practices are in such cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use MulticastChannel
type here, though that wouldn't enforce exactly stdChannel
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, probably not worth it then. I guess that somebody might find it useful to pass in a unicast channel anyway, so it's better to not strangle one's creativity.
Also I was wondering yesterday - should we maybe just move export const delay = call.bind(null, _delay) We've kinda made this for helpers in 0.14 and Im wondering if we should do the same for this one. |
👍 for me, in our projects, we only use |
Gonna update the code + tests later with the change, but I guess if you have time you can already include it in this PR |
Updated typings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hope there won't be many other changes in the API, thanks as always!
multicastChannel
andstdChannel
arrayOfDeferred
namerunSaga
APITask
interfacecall
,apply
,cps
etc. (fixes Typescript Typings for result ofcall
effect #1075)