Skip to content

Commit

Permalink
fix(json-crdt): 🐛 increment model.tick on .reset()
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Dec 2, 2023
1 parent 53df0e5 commit 71d2e42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/json-crdt/model/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class Model<N extends JsonNode = JsonNode> implements Printable {
* through this method.
*
* For advanced use only, better use `applyPatch` instead. You MUST increment
* the `tick` property and call `onchange` after calling this method.
* the `tick` property and call the necessary event emitters manually.
*
* @param op Any JSON CRDT Patch operation
* @ignore
Expand Down Expand Up @@ -349,6 +349,7 @@ export class Model<N extends JsonNode = JsonNode> implements Printable {
api.node = newNode;
newNode.api = api;
});
this.tick++;
this.onreset?.();
}

Expand Down

0 comments on commit 71d2e42

Please sign in to comment.