the only cases when promisifyRoutine would correctly handle the trigger action creator parameters is when it's an identity function with 0 or 1 parameters, since otherwise all other parameters would be undefined. And it's a bit misleading that it's called payload while actually it's a parameter to trigger action creator.
From what I understand, there are 2 ways of addressing this:
Use payload as actual payload instead of trigger action creator parameter - but that would be somewhat limiting
Swap payload and dispatch in promisified creator so that we can consume tail arguments and unwrap them when passing to trigger action creator.
I'd go with second one of course. Happy to provide a PR if approach is agreed, but it's a quite breaking change what bothers me.
To my understanding, due to this
https://github.com/afitiskin/redux-saga-routines/blob/5d2d6bf3325a7cb236705007e92b292030a9e45a/src/promisifyRoutine.js#L4
and this
https://github.com/afitiskin/redux-saga-routines/blob/5d2d6bf3325a7cb236705007e92b292030a9e45a/src/routinePromiseWatcherSaga.js#L24
the only cases when
promisifyRoutine
would correctly handle the trigger action creator parameters is when it's an identity function with 0 or 1 parameters, since otherwise all other parameters would be undefined. And it's a bit misleading that it's calledpayload
while actually it's a parameter to trigger action creator.From what I understand, there are 2 ways of addressing this:
payload
as actual payload instead of trigger action creator parameter - but that would be somewhat limitingpayload
anddispatch
in promisified creator so that we can consume tail arguments and unwrap them when passing to trigger action creator.I'd go with second one of course. Happy to provide a PR if approach is agreed, but it's a quite breaking change what bothers me.