Implementing a robust undo-redo system, especially in collaborative applications, is complex and involves significant challenges such as state management, conflict resolution, and handling asynchronous operations. The post discusses different approaches like the Command and Memento patterns, modeling state graphs, and strategies for dealing with conflicts. Emphasis is placed on providing a seamless user experience and managing the scope of undo-redo operations. Real-world implementation details and challenges are explored through a proof-of-concept app.

22m read timeFrom dev.to
Post cover image
Table of contents
Context and motivationUndo/ redo is a strange beastModelling a branching state-graphThe question of scopeMemento vs. Command patternWe can still have conflicts, can't we?Can we simply ignore conflicts?Dealing with conflicts - undo-manager perspective (in theory)Dealing with conflicts - undo-manager perspective (in practice)Dealing with conflicts - app perspectiveGetting the user experience rightDealing with asynchronyPlaces where my demo implementation falls shortClosing thoughts

Sort: