changeset 2088:0617b6006ec4

ts cleanup
author drewp@bigasterisk.com
date Sun, 29 May 2022 02:53:46 -0700
parents 1b6e7016e3de
children bbd6816d9e9e
files light9/web/AutoDependencies.ts light9/web/SyncedGraph.ts
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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<string>) {
@@ -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);
     }
   }
 }
--- 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).