introvertuous / redux-undone Goto Github PK
View Code? Open in Web Editor NEWRedo / Undo for redux.
License: MIT License
Redo / Undo for redux.
License: MIT License
The way that I usually handle clusters of the same action that all need to be undone with a single undo action, is to create an additional action that is not undoable and perform the undoable action first and subsequent calls using the non undoable variant, so you get a proper undo to the initiating action. This method is super tedious and requires lots of boilerplate.
A better way would be to have an interval, and compare the time between actions of a particular type. So, if an action is dispatched, we push a historical entry, and then the same action is dispatched less than 100ms later, we do not add a historical entry for that action.
ideally history data would be stored in the redux store that the client is building, which would make for a clean api.
once complete, make sure to fix the example:
132737a#diff-fd9c790e80143e73075639ef6d05317c
When you use a thunk for a transformation, and dispatch more than one action we run in a bit of an issue. If these actions are both undo-able then we are creating more future entries than we are removing from the past, which does not feel correct.
the ordering probably should have been: (action, prevState, nextState)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.