JavaScript Design Patterns - Behavioral - Command
The command pattern allows encapsulating a request as an object. This transformation lets you pass requests as method arguments, delay or queue a request’s execution, and support undoable operations.
In the below example, we encapsulate the on/off in...
nhannguyen.hashnode.dev1 min read