Passing messages without saving result into undo history
I there a way to ignore some messages? Say I'm in the middle of inputing text, and I don't want to save each letter into history, and save it only after input finished.
I'd suggest to introduce new kind of message (and corresponding function), Pass subaction.
Is it a good idea? Should I make a PR to demo what I suggest?
PR would be very welcome :)
@rohanorton I'll create it in a few days, after I try it on a real project.
I had the same question a few days ago. What I did in my app is to add a new history state on space input so that the history is word based, and not letter based.
Here is the commit: https://github.com/cbenz/noteminer/commit/d0f654582635745be4b7bbe7dbe2e6ce9b2f6ec4#diff-de84bd170bc37fbce0a7076c0125dd29R768
I know it is quite hacky but perhaps it helps.
I'm interested in this. I thought that a reasonable approach would be to use onfocus on the text input to create an 'undo block', then everything is put in that one block until the 'onblur' event which would close that block. I think I am more used to thinking of this in terms of object-oriented approaches. Interesting to see the mapPresent approach above. That also makes sense, though again you need some state to know when to apply that versus a new undo state. I think.
redux-undo provide filtering and grouping for this https://github.com/omnidan/redux-undo
I use a a series of 'hook' functions (one for undo-redo, another one for interacting with the DOM etc.).
Old topic I know. But maybe someone is still interested. I made a version (F#) which is able to do "non-persistent" updates, transactions for bulk updates and jumping to a new present state by clicking in a list of states. Please, bear with me for the functional code. I'm pretty new to this stuff.
Can you also write an elm version pls :joy:
JK thank you for letting us know where to look to :)