Skip to content

Commit 673d693

Browse files
authored
Merge pull request #692 from streamich/safe-flush
Make change flush safe
2 parents a179561 + 91a37ae commit 673d693

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)