jeffbski/redux-logic

reject in transform hook for Typescript

saurabhsood91 opened this issue · 2 comments

Looking at the documentations for the transform hook, there seems to be a reject parameter. Also, it is mentioned that we can pass undefined to forward nothing (or reject the action)
https://github.com/jeffbski/redux-logic/blob/master/src/createLogic.js#L110

I tried making use of this in Typescript, but I do not see the reject parameter in the type definitions.
https://github.com/jeffbski/redux-logic/blob/master/definitions/logic.d.ts#L218

Am I missing something?

Yes, the transform hook and validate hook are the same so you can use a reject. The two hooks exist to provide some description of how you are using them and in most cases if people need to reject they are using validate, while transform they typically use just the accept.

However you are correct that the typescript def should allow both. Thanks for the PR. I am merging it now.

It landed in v2.0.1