Skip to content

Commit 0b14ae0

Browse files
committed
refactor(json-crdt): 💡 move PatchLog to /history folder
1 parent 072b194 commit 0b14ae0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/json-crdt/file/PatchLog.ts renamed to src/json-crdt/history/PatchLog.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ import {first, next} from '../../util/trees/util';
66
import type {Printable} from '../../util/print/types';
77

88
export class PatchLog implements Printable {
9-
public static fromModel(model: Model<any>): PatchLog {
9+
public static fromNewModel(model: Model<any>): PatchLog {
1010
const start = new Model(model.clock.clone());
1111
const log = new PatchLog(start);
12-
if (model.api.builder.patch.ops.length) {
13-
const patch = model.api.flush();
14-
log.push(patch);
15-
}
12+
const api = model.api;
13+
if (api.builder.patch.ops.length) log.push(api.flush());
1614
return log;
1715
}
1816

src/json-crdt/history/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Patch} from "../../json-crdt-patch";
2-
import {PatchLog} from "../file/PatchLog";
2+
import {PatchLog} from "../history/PatchLog";
33
import {Model} from "../model";
44

55
/**

0 commit comments

Comments
 (0)