Loading…
Loading…
undo() and redo() that reverse/reapply the most recent edit(s), in order.Undo/redo is the textbook use case for one specific pattern — the same one covered in this course's Behavioral Patterns lesson for exactly this reason. Which pattern turns "an action that already happened" into something that can be stored, reversed, and replayed?
Design your own solution first — on paper, a whiteboard, or your own IDE — before checking the reference.