# HG changeset patch # User drewp@bigasterisk.com # Date 1653818026 25200 # Node ID 0617b6006ec4573ed1163b3549cfc357c633e515 # Parent 1b6e7016e3dec1fa2d102963d4a476f7fb92cdf9 ts cleanup diff -r 1b6e7016e3de -r 0617b6006ec4 light9/web/AutoDependencies.ts --- a/light9/web/AutoDependencies.ts Sun May 29 01:49:34 2022 -0700 +++ b/light9/web/AutoDependencies.ts Sun May 29 02:53:46 2022 -0700 @@ -43,16 +43,16 @@ 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 @@ 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 @@ 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 @@ // 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 -r 1b6e7016e3de -r 0617b6006ec4 light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts Sun May 29 01:49:34 2022 -0700 +++ b/light9/web/SyncedGraph.ts Sun May 29 02:53:46 2022 -0700 @@ -218,7 +218,7 @@ }); } - 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).