From c12af32a5ade0240630ff3b9fc11d877d6a16825 Mon Sep 17 00:00:00 2001
From: Apoorv Khandelwal <apoorv.khand@gmail.com>
Date: Sun, 20 Nov 2022 22:03:53 +0000
Subject: [PATCH] feat: Dockerfile and automated container build (#230)

---
 assets/js/semantic-search.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/assets/js/semantic-search.js b/assets/js/semantic-search.js
index 3cebe5a..4382817 100644
--- a/assets/js/semantic-search.js
+++ b/assets/js/semantic-search.js
@@ -15,7 +15,15 @@
   return (await response.json());
 }
 
-registerHandlers((e) => {
+function debounce(func, timeout = 200) {
+  let timer;
+  return (...args) => {
+    clearTimeout(timer)
+    timer = setTimeout(() => { func.apply(this, args); }, timeout)
+  };
+}
+
+registerHandlers(debounce((e) => {
   term = e.target.value
   if (term !== "") {
     searchContents(term)
@@ -27,4 +35,4 @@
       ))
       .then(results => displayResults(results))
   }
-})
+}))

--
Gitblit v1.10.0