The Command pattern encapsulates a request as an object, allowing parameterization of clients with different requests, queuing of requests, logging, and support for undoable operations.
The Command pattern turns a request into a stand-alone object that contains all information about the request. This transformation allows you to parameterize methods with different requests, delay or queue a request's execution, and support undoable operations. This pattern is fundamental to Redux (actions), command-line interfaces, and transaction systems. In frontend development, it's commonly used for undo/redo functionality, macro recording, and action dispatching.