export function throttle void>( func: T, timeFrame: number, ): (...args: Parameters) => void { let lastTime = 0; return function (this: any, ...args: Parameters) { const now = new Date(); if (now.getTime() - lastTime >= timeFrame) { func.apply(this, args); lastTime = now.getTime(); } }; }