Converted draw actions storage to collapsed representation

Moved to command pattern for action application
This commit is contained in:
Mitchell McCaffrey
2021-02-04 09:11:27 +11:00
parent 2fc7f4f162
commit fa1f6fe18f
16 changed files with 366 additions and 137 deletions

View File

@@ -1,4 +1,4 @@
import { applyChange, diff as deepDiff } from "deep-diff";
import { applyChange, revertChange, diff as deepDiff } from "deep-diff";
export function applyChanges(target, changes) {
for (let change of changes) {
@@ -6,4 +6,10 @@ export function applyChanges(target, changes) {
}
}
export function revertChanges(target, changes) {
for (let change of changes) {
revertChange(target, true, change);
}
}
export const diff = deepDiff;