Open chmac opened 3 years ago
It seems like in my tests putResolve()
from typed-redux-saga
doesn't behave the same as putResolve()
from redux-saga/effects
when used like:
const result = yield* putResolve(action())
When I switch to the redux-saga putResolve()
then result
is populated with the correct value, otherwise its undefined
. Maybe it's something else in my config that's causing the issue. I can't figure it out, figured I'd mention just in case.
Firstly, massive thanks for this library. As I start my journey into the saga wildnerness, being able to trust the types I get back is a HUGE win. Really appreciate this library.
I'm also using redux-saga-promise-actions so that I can await sagas from within other sagas. In my adventures there, I've started to suspect that the type definitions for
put
andputResolve
should be different, but they appear to be the same.https://github.com/agiledigital/typed-redux-saga/blob/bc524857403989fc518e00e5d369f899fd58594e/types/index.d.ts#L175-L185
In VSCode when I try
const result = yield* putResolve(action())
I get the type ofresult
as the return type ofaction
. The same forput()
instead ofputResolve()
. ButputResolve()
should be the return type ofstore.dispatch(action())
I think.I've tried playing around with the types to see if I can figure out the fix, but unfortunately I'm stumped, my TypeScript fu is insufficient to the task.