remove unused debouncer class

Signed-off-by: Tobias Erbshäußer <tobias@tesoft.dev>
This commit is contained in:
2026-05-24 09:23:11 +02:00
parent 6636ce6c95
commit 1977ee67f0
-30
View File
@@ -84,36 +84,6 @@ export function onReady(callback: () => void, ...components: TesoftComponent[])
}
}
export class Debouncer<T extends any[]> {
private timer: number | null;
private readonly apply: (...args: T) => void;
constructor(apply: (...args: T) => void, timeoutMs: number = 300) {
this.timer = null;
this.apply = (...args: T) => {
if (this.timer !== null) {
clearTimeout(this.timer);
this.timer = null;
}
this.timer = setTimeout(() => {
apply(...args);
}, timeoutMs);
};
}
run(...args: T) {
this.apply(...args);
}
stop() {
if (this.timer !== null) {
clearTimeout(this.timer);
this.timer = null;
}
}
}
export function sendApiPost(path: string, data: Record<string, any>): Promise<Response> {
const url = new URL(`/api/${path}`, location.origin);