diff --git a/src/common/SearchInput.svelte b/src/common/SearchInput.svelte index 3f655646a..dfbb7570b 100644 --- a/src/common/SearchInput.svelte +++ b/src/common/SearchInput.svelte @@ -3,6 +3,15 @@ import { writable } from "svelte/store"; export const query = writable(""); + + let timer; + let delay = 100; + const debounce = (v, fn) => { + clearTimeout(timer); + timer = setTimeout(() => { + fn(v); + }, delay); + };