Skip to content

Commit d72d493

Browse files
1 parent 518e7ab commit d72d493

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,8 @@ $turnOn = new TurnOn($bulb);
13211321
$turnOff = new TurnOff($bulb);
13221322

13231323
$remote = new RemoteControl();
1324-
$remoteControl->submit($turnOn); // Bulb has been lit!
1325-
$remoteControl->submit($turnOff); // Darkness!
1324+
$remote->submit($turnOn); // Bulb has been lit!
1325+
$remote->submit($turnOff); // Darkness!
13261326
```
13271327

13281328
Command pattern can also be used to implement a transaction based system. Where you keep maintaining the history of commands as soon as you execute them. If the final command is successfully executed, all good otherwise just iterate through the history and keep executing the `undo` on all the executed commands.

0 commit comments

Comments
 (0)