Changeset - 0617b6006ec4
[Not reviewed]
default
0 2 0
drewp@bigasterisk.com - 3 years ago 2022-05-29 09:53:46
drewp@bigasterisk.com
ts cleanup
2 files changed with 7 insertions and 7 deletions:
0 comments (0 inline, 0 general)
light9/web/AutoDependencies.ts
Show inline comments
 
@@ -43,7 +43,7 @@ export class AutoDependencies {
 

	
 
    const h = new Handler(func, label);
 
    const tailChildren = this.handlerStack[this.handlerStack.length - 1].innerHandlers;
 
    const matchingLabel = filter(tailChildren, (c: { label: any }) => c.label === label).length;
 
    const matchingLabel = filter(tailChildren, (c: Handler) => c.label === label).length;
 
    // ohno, something depends on some handlers getting run twice :(
 
    if (matchingLabel < 2) {
 
      tailChildren.push(h);
 
@@ -52,7 +52,7 @@ export class AutoDependencies {
 
    // todo: this may fire 1-2 times before the
 
    // graph is initially loaded, which is a waste. Try deferring it if we
 
    // haven't gotten the graph yet.
 
    return this._rerunHandler(h, undefined);
 
    this._rerunHandler(h, undefined);
 
  }
 
  //console.timeEnd("handler #{label}")
 
  //@_logHandlerTree()
 
@@ -82,9 +82,9 @@ export class AutoDependencies {
 
        indent += "  ";
 
      }
 
      log(`${indent} \"${h.label}\" ${h.patterns.length} pats`);
 
      return Array.from(h.innerHandlers).map((c: any) => prn(c, depth + 1));
 
      Array.from(h.innerHandlers).map((c: any) => prn(c, depth + 1));
 
    };
 
    return prn(this.handlers, 0);
 
    prn(this.handlers, 0);
 
  }
 

	
 
  _handlerIsAffected(child: Handler, patchSubjs: Set<string>) {
 
@@ -123,7 +123,7 @@ export class AutoDependencies {
 
        rerunInners(child);
 
      }
 
    };
 
    return rerunInners(this.handlers);
 
    rerunInners(this.handlers);
 
  }
 

	
 
  askedFor(s: Quad_Subject | null, p: Quad_Predicate | null, o: Quad_Object | null, g: Quad_Graph | null) {
 
@@ -131,7 +131,7 @@ export class AutoDependencies {
 
    // quads in the given pattern.
 
    const current = this.handlerStack[this.handlerStack.length - 1];
 
    if (current != null && current !== this.handlers) {
 
      return current.patterns.push({ subject: s, predicate: p, object: o, graph: g } as QuadPattern);
 
      current.patterns.push({ subject: s, predicate: p, object: o, graph: g } as QuadPattern);
 
    }
 
  }
 
}
light9/web/SyncedGraph.ts
Show inline comments
 
@@ -218,7 +218,7 @@ export class SyncedGraph {
 
    });
 
  }
 

	
 
  runHandler(func: HandlerFunc, label: string) {
 
  public runHandler(func: HandlerFunc, label: string) {
 
    // runs your func once, tracking graph calls. if a future patch
 
    // matches what you queried, we runHandler your func again (and
 
    // forget your queries from the first time).
0 comments (0 inline, 0 general)