mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-18 05:25:04 +00:00
21 lines
361 B
JavaScript
21 lines
361 B
JavaScript
import {Command} from './command.js';
|
|
|
|
export class CommandSequence extends Command {
|
|
constructor(commands) {
|
|
super();
|
|
this.commands = commands;
|
|
|
|
}
|
|
execute() {
|
|
this.commands.forEach((command) => command.execute())
|
|
}
|
|
|
|
undo() {
|
|
this.commands.slice().reverse().forEach((command) => command.undo())
|
|
}
|
|
|
|
redo() {
|
|
this.execute();
|
|
}
|
|
}
|