export type ThrottledFunction = (...args: T) => void; export function throttle( func: ThrottledFunction, wait: number ) { let lastExecution = 0; return (...args: T) => { const now = Date.now(); if (now - lastExecution >= wait) { lastExecution = now; func(...args); } }; }