Skip to content

Commit dcbbc54

Browse files
committed
feat(json-crdt): 🎸 inprove JsonPatchStore interface
1 parent e737bc0 commit dcbbc54

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/json-crdt/json-patch/JsonPatchStore.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ import type {JsonNode, JsonNodeView} from '../nodes';
99
export class JsonPatchStore<N extends JsonNode = JsonNode<any>> implements SyncStore<Readonly<JsonNodeView<N>>> {
1010
public readonly node: N;
1111
public readonly api: JsonNodeApi<N>;
12-
protected _patcher: JsonPatch<N>;
13-
protected _pfx: string;
12+
public readonly patcher: JsonPatch<N>;
13+
public readonly pfx: string;
1414

1515
constructor(
1616
protected readonly model: Model<N>,
17-
protected readonly path: Path = [],
17+
public readonly path: Path = [],
1818
) {
19-
this._pfx = path.length ? path.join() : '';
19+
this.pfx = path.length ? path.join() : '';
2020
const api = model.api;
2121
this.node = api.find(path) as N;
2222
this.api = api.wrap(this.node) as unknown as JsonNodeApi<N>;
23-
this._patcher = new JsonPatch(model, path);
23+
this.patcher = new JsonPatch(model, path);
2424
}
2525

2626
public readonly update = (change: Operation | Operation[]): void => {
2727
const ops = Array.isArray(change) ? change : [change];
28-
this._patcher.apply(ops);
28+
this.patcher.apply(ops);
2929
};
3030

3131
// ---------------------------------------------------------------- SyncStore

0 commit comments

Comments
 (0)