Skip to content

Commit beb3bfb

Browse files
committed
memento pattern main
1 parent cb9df94 commit beb3bfb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

memento-pattern/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class MementoPattern {
2020
originator.restore(caretaker.undo());
2121
console.log(originator.getState());
2222

23+
// can be done like this but SRP and encapsulation is broken
2324
let memento = new Memento(new State('state4', 4));
2425
caretaker.addMemento(memento);
2526
let memento2 = new Memento(new State('state3', 2));

0 commit comments

Comments
 (0)