Skip to content
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

Merged
merged 13 commits into from
Nov 9, 2017
Merged

Conversation

aikoven
Copy link
Contributor

@aikoven aikoven commented Nov 8, 2017

  • Remove deprecated APIs
  • Update Channels, add multicastChannel and stdChannel
  • Fix arrayOfDeferred name
  • Update runSaga API
  • Support Effect Middleware
  • Update Task interface
  • Add generic parameters for return types of functions passed to call, apply, cps etc. (fixes Typescript Typings for result of call effect #1075)

export interface RunSagaOptions<A, S> {
context?: object;
subscribe?: Subscribe<A>;
channel?: PredicateTakeableChannel<A>;
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@Andarist
Copy link
Member

Andarist commented Nov 8, 2017

Also I was wondering yesterday - should we maybe just move delay into redux-saga/effects and make it:

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.

@aikoven
Copy link
Contributor Author

aikoven commented Nov 8, 2017

should we maybe just move delay into redux-saga/effects

👍 for me, in our projects, we only use delay inside call.

@Andarist
Copy link
Member

Andarist commented Nov 8, 2017

Gonna update the code + tests later with the change, but I guess if you have time you can already include it in this PR

@Andarist
Copy link
Member

Andarist commented Nov 8, 2017

delay as effect 🎉

@aikoven
Copy link
Contributor Author

aikoven commented Nov 9, 2017

Updated typings.

Copy link
Member

@Andarist Andarist left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript Typings for result of call effect
2 participants