afitiskin / redux-saga-routines

Routines for redux-saga
MIT License
249 stars 33 forks source link

promisifyRoutine would only work for 0/1-parameter trigger action creator #83

Open alexey-pelykh opened 3 years ago

alexey-pelykh commented 3 years ago

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 called payload while actually it's a parameter to trigger action creator.

From what I understand, there are 2 ways of addressing this:

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.

alexey-pelykh commented 3 years ago

Same thing as described in https://github.com/afitiskin/redux-saga-routines/issues/76