Changeset - c070f46c0761
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-30 07:59:20
drewp@bigasterisk.com
you can ask to apply empty patch and it will no-op
1 file changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
light9/web/SyncedGraph.ts
Show inline comments
 
@@ -153,18 +153,18 @@ export class SyncedGraph {
 
  applyAndSendPatch(patch: Patch) {
 
    console.time("applyAndSendPatch");
 
    if (!this.client) {
 
      log("not connected-- dropping patch");
 
      return;
 
    }
 
    if (patch.isEmpty()) throw "should not get to this point with empty patch";
 

	
 
    this._applyPatch(patch);
 
    if (this.client) {
 
      log("sending patch:\n", patch.dump());
 
      this.client.sendPatch(patch);
 
    if (!patch.isEmpty()) {
 
      this._applyPatch(patch);
 
      if (this.client) {
 
        log("sending patch:\n", patch.dump());
 
        this.client.sendPatch(patch);
 
      }
 
    }
 
    console.timeEnd("applyAndSendPatch");
 
  }
 

	
 
  _applyPatch(patch: Patch) {
 
    // In most cases you want applyAndSendPatch.
0 comments (0 inline, 0 general)