agiledigital / typed-redux-saga

An attempt to bring better TypeScript typing to redux-saga.
MIT License
315 stars 33 forks source link

Add a type for take patterns #695

Open Ha-limLee opened 1 year ago

Ha-limLee commented 1 year ago

According to redux saga docs, take effect can receive patterns(array of pattern).

But current result of the effect is any.

// action is any
// this should be FooAction | BarAction
const action = yield* take([foo, bar]);

So I added a type overloading to make it work properly.