This commit is contained in:
nub31
2026-03-16 22:00:24 +01:00
parent d677582757
commit 3bf281c7a7
41 changed files with 1790 additions and 7 deletions

8
src/lib/util/debounce.ts Normal file
View File

@@ -0,0 +1,8 @@
export function debounce<T extends Function>(cb: T, wait = 500) {
let h: any;
let callable = () => {
clearTimeout(h);
h = setTimeout(() => cb(), wait);
};
return callable;
}