remove debounce in favor of solid-primitive

This commit is contained in:
Chris Kruining 2025-01-08 11:31:16 +01:00
parent caa35c92e9
commit 7e5af28ac2
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
7 changed files with 6 additions and 49 deletions

View file

@ -23,18 +23,6 @@ const decodeReplacer = (_: any, char: string) => ({
}[char.charAt(0)] ?? '');
export const decode = (subject: string): string => subject.replace(decodeRegex, decodeReplacer);
export const debounce = <T extends (...args: any[]) => void>(callback: T, delay: number): ((...args: Parameters<T>) => void) => {
let handle: ReturnType<typeof setTimeout> | undefined;
return (...args: Parameters<T>) => {
if (handle) {
clearTimeout(handle);
}
handle = setTimeout(() => callback(...args), delay);
};
};
export const deepCopy = <T>(original: T): T => {
if (typeof original !== 'object' || original === null || original === undefined) {
return original;