Files
OpenCut/apps/web/src/lib/commands/batch-command.ts
T

26 lines
423 B
TypeScript
Raw Normal View History

2026-02-08 22:21:17 +01:00
import { Command } from "./base-command";
export class BatchCommand extends Command {
constructor(private commands: Command[]) {
super();
}
execute(): void {
for (const command of this.commands) {
command.execute();
}
}
undo(): void {
for (const command of [...this.commands].reverse()) {
command.undo();
}
}
redo(): void {
for (const command of this.commands) {
command.execute();
}
}
}