/* eslint-disable @typescript-eslint/no-explicit-any */ export function debounce any>(func: T, timeout = 300) { let timer: ReturnType; return function (this: any, ...args: Parameters) { clearTimeout(timer); timer = setTimeout(() => { func.apply(this, args); }, timeout); }; }