Skip to content

Commit 91a37ae

Browse files
committed
fix(json-crdt): 🐛 make change flush safe
1 parent a179561 commit 91a37ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/json-crdt/model/api/ModelApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ export class ModelApi<N extends JsonNode = JsonNode> implements SyncStore<JsonNo
286286
public flush(): Patch {
287287
const patch = this.builder.flush();
288288
this.next = 0;
289-
this.onFlush.emit(patch);
289+
if (patch.ops.length) this.onFlush.emit(patch);
290290
return patch;
291291
}
292292

0 commit comments

Comments
 (0)