Changeset - eeb2b3928715
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 20 months ago 2023-05-24 19:11:28
drewp@bigasterisk.com
fix 'unlink' button. (event was not well-typed)
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
light9/web/SyncedGraph.ts
Show inline comments
 
@@ -188,35 +188,35 @@ export class SyncedGraph {
 
    for (let quad of Array.from(patch.dels)) {
 
      //log("remove #{JSON.stringify(quad)}")
 
      const did = this.graph.removeQuad(quad);
 
    }
 
    //log("removed: #{did}")
 
    for (let quad of Array.from(patch.adds)) {
 
      this.graph.addQuad(quad);
 
    }
 
    log("applied patch locally", patchSizeSummary(patch));
 
    this._autoDeps.graphChanged(patch);
 
  }
 

	
 
  getObjectPatch(s: N3.NamedNode, p: N3.NamedNode, newObject: N3.Quad_Object, g: N3.NamedNode): Patch {
 
  getObjectPatch(s: N3.NamedNode, p: N3.NamedNode, newObject: N3.Quad_Object | null, g: N3.NamedNode): Patch {
 
    // make a patch which removes existing values for (s,p,*,c) and
 
    // adds (s,p,newObject,c). Values in other graphs are not affected.
 
    const existing = this.graph.getQuads(s, p, null, g);
 
    return {
 
      dels: existing,
 
      adds: [this.Quad(s, p, newObject, g)],
 
      adds: newObject !== null ? [this.Quad(s, p, newObject, g)] : [],
 
    };
 
  }
 

	
 
  patchObject(s: N3.NamedNode, p: N3.NamedNode, newObject: N3.Quad_Object, g: N3.NamedNode) {
 
  patchObject(s: N3.NamedNode, p: N3.NamedNode, newObject: N3.Quad_Object | null, g: N3.NamedNode) {
 
    this.applyAndSendPatch(this.getObjectPatch(s, p, newObject, g));
 
  }
 

	
 
  clearObjects(s: N3.NamedNode, p: N3.NamedNode, g: N3.NamedNode) {
 
    return this.applyAndSendPatch({
 
      dels: this.graph.getQuads(s, p, null, g),
 
      adds: [],
 
    });
 
  }
 

	
 
  public runHandler(func: HandlerFunc, label: string) {
 
    // runs your func once, tracking graph calls. if a future patch
0 comments (0 inline, 0 general)