-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support slice reducers #147
Comments
Hi @mauron85 I just made a pull request for this issue |
Nice. In meantime I realised that redux-undo is not suitable for my use case as I need to undo actions, not just revert state of the UI. |
@mauron85 what's the difference in that case? If your reducer is undoable, then the state changes associated with the action will be undone. The action will be undone, no? If you're referring to thunk actions (actions that have side-effects that result in more actions), you can look into filtering. |
I also need to undo action on the server, but I cannot determine which action it was from state change. And redux-undo, only store state changes, not action types/names which lead to those changes. Hopefully I expressed myself clearly. :-) |
I see, so not a redux action but an API call. Yeah, undoing side effects outside the redux store is outside the scope of this library. I assume there would have to be specific logic for each back-end call to undo the call. Though in either case I don't think there would be a simple way to undo a deletion |
Yes, https://github.com/powtoon/redux-undo-redo is doing it in custom middleware and revertingActions. Anyway for state/UI only undos, your module is perfect. |
Ah interesting, definitely provides a backend-compatible solution at the cost of usability. I'm thinking this sort of functionality could be incorporated into this library as a config option. I'll look into it when I have the time |
Created a new issue (#150) and closing this one since the PR has been merged |
Some reducers need to access state from different slice of state as written in
http://redux.js.org/docs/recipes/reducers/BeyondCombineReducers.html#sharing-data-between-slice-reducers
Example
Currently undoable only pass state and action to actual reducers, so in case of
routesReducer
state.deliveries
will be null. Fix should be easy.The text was updated successfully, but these errors were encountered: