export function throttle<T extends (...args: unknown[]) => void>(func: T, interval: number) {
  let isRunning = false;

  return function (this: unknown, ...args: Parameters<T>) {
    if (!isRunning) {
      isRunning = true;
      func.apply(this, args);
      setTimeout(() => {
        isRunning = false;
      }, interval);
    }
  };
}
