Move some things around

This commit is contained in:
Gregory Schier
2023-03-08 23:20:15 -08:00
parent f4f438d9fe
commit bf8f12274f
19 changed files with 617 additions and 705 deletions

11
src-web/lib/debounce.ts Normal file
View File

@@ -0,0 +1,11 @@
export function debounce(fn: (...args: any[]) => any, delay: number) {
let timer: ReturnType<typeof setTimeout>;
const result = function (...args: Parameters<typeof fn>) {
clearTimeout(timer);
timer = setTimeout(() => fn(...args), delay);
};
result.cancel = function () {
clearTimeout(timer);
};
return result;
}