diff --git a/light9/web/AutoDependencies.ts b/light9/web/AutoDependencies.ts --- a/light9/web/AutoDependencies.ts +++ b/light9/web/AutoDependencies.ts @@ -43,16 +43,16 @@ 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); } - //console.time("handler #{label}") + //console.time("handler #{label}") // 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) { @@ -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); } } } diff --git a/light9/web/SyncedGraph.ts b/light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts +++ b/light9/web/SyncedGraph.ts @@ -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).