Closed kxlow closed 4 years ago
And on line 84, you can just use
A['type']
instead ofPick<A, 'type'>['type']
🤦♂ Thanks!
Looks good to me.
@omnidan ?
@nmay231 looks good to me as well!
Thanks @kxlow !
Thanks for all your help and for maintaining this project! :)
Will there be a published release of including these changes? I'd like to use this in my project. 😅
Yes, as soon as @ omnidan is able, he will publish those changes. Life is busy atm.
If you want to still use those typings now, you can remove then reinstall redux-undo
from the cloned folder with npm i "path/to/local/folder/redux-undo"
. Or you can temporarily install directly from github adding this to package.json "redux-undo": "omnidan/redux-undo#master"
We'll try to get the official version out soon though.
@kxlow @nmay231 sorry for the delay! I have published a new version 1.0.1
of redux-undo with the stronger type enforcements. Let me know if everything works fine for you now. Thanks for the PR!
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
TypeScript definition update
What is the current behavior? (You can also link to an open issue here)
You can provide any string into a filter function, even if it not a valid action for the given reducer.
What is the new behavior?
When using TypeScript, TypeScript will display an error when you are giving filter functions an invalid action.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
It shouldn't, if I did my types correctly.