zskarte / zskarte-client

Variables should not be initialized to undefined JS-0126
Anti-pattern
Minor
8 months ago8 months old
It's not necessary to initialize 'timeoutId: number | undefined' to undefined
 1/* eslint-disable @typescript-eslint/no-explicit-any */
 2export const debounce = (callback: any, wait: number) => {
 3  let timeoutId: number | undefined = undefined; 4  return (...args: any[]) => {
 5    window.clearTimeout(timeoutId);
 6    timeoutId = window.setTimeout(() => {