Skip to content

Commit

Permalink
Merge pull request #469 from streamich/tick
Browse files Browse the repository at this point in the history
Increment model.tick on .reset()
  • Loading branch information
streamich authored Dec 2, 2023
2 parents 53df0e5 + 71d2e42 commit 1796627
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 1796627

Please sign in to comment.