# An Action You Can Hold

An Action You Can Hold: Command: An Action You Can Hold, Undo and Redo with Commands.

Updated: November 17, 2026

1. [Command: An Action You Can Hold](https://www.ask-codey.com/lessons/dp-command) (Journeyman): When the dispatcher's plan for the morning is stored as rows of text and run by a switch on each action's name, every new kind of action means editing the runner; the Command pattern turns "Assign package 42 to Dana" into an object that can be stored, queued, logged and run later.
2. [Undo and Redo with Commands](https://www.ask-codey.com/lessons/dp-undo-redo) (Journeyman): An undo button that remembers only the last change can't take back two mistakes, and can't redo anything; when each command knows how to reverse itself, a stack of done commands and a stack of undone ones give the dispatcher as many undos and redos as she needs.

Source: https://www.ask-codey.com/courses/design-patterns/topics/dp-an-action-you-can-hold
