Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
So the high level idea was avoid the typical problem with undo/redo where if you go back and make a change based on a past state, you’d lose all of the progress after that point. The obvious solution is branching but I still wanted to express the history as a single timeline without a confusing UI that actually branches. So what I’m doing is essentially appending the branch to the end of the history timeline and simply switching the color of the bars in the UI tool to indicate the branch as a new ‘block’. So the UI element is very close to the array based implementation in that sense. The state diffing works across my entire state class. You can see a similar implementation in my sekoia js library here: https://github.com/monokee/Sekoia/tree/master/src/modules/state