Open Buggytheclown opened 3 years ago
Hey, great to hear! Yes I'm always open for pull requests that improve the library. :)
On the features you suggested:
Some advice for pull requests:
maybe I need the "clear history" feature, but this will be more imperative than "preserve"
Hey @Buggytheclown just wanted to get back to you and give you an update:
(state: S, action: A, additionalState: T) => S
. Where additionalState could be something like "is menu open". This is not strictly necessary since you can also pass the additionalState in the action, but sometimes its just more convenient from my experience to have it as a third parameter. So if you also encounter this situation I will look into implementing this.
First of all, thanks for your work, it helped us a lot. We start using undox in prod.
Features I am missing: 1) limit - some reducers are tricky and take a little time to execute. Undo takes almost 60ms for a 200-action history. The user can perform 20 actions per minute. 2) filter - I don't want to include some actions (for example, open / close a menu) in the history 3) preserve - for example FETCH_SUCCESS action must be in history to replay the history correctly. But I don't want to let the user undo the FETCH_SUCCESS action.
As a work around i wrap the undox reducer. Let me know if you open to Pull requests