Skip to content

Commit 1796627

Browse files
authored
Merge pull request #469 from streamich/tick
Increment model.tick on .reset()
2 parents 53df0e5 + 71d2e42 commit 1796627

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/json-crdt/model/Model.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class Model<N extends JsonNode = JsonNode> implements Printable {
169169
* through this method.
170170
*
171171
* For advanced use only, better use `applyPatch` instead. You MUST increment
172-
* the `tick` property and call `onchange` after calling this method.
172+
* the `tick` property and call the necessary event emitters manually.
173173
*
174174
* @param op Any JSON CRDT Patch operation
175175
* @ignore
@@ -349,6 +349,7 @@ export class Model<N extends JsonNode = JsonNode> implements Printable {
349349
api.node = newNode;
350350
newNode.api = api;
351351
});
352+
this.tick++;
352353
this.onreset?.();
353354
}
354355

0 commit comments

Comments
 (0)