diff --git a/src/common/debounce.ts b/src/common/debounce.ts index e3bcd36b..8bcf039a 100644 --- a/src/common/debounce.ts +++ b/src/common/debounce.ts @@ -1,9 +1,11 @@ -export const debounce = - ) => ReturnType>(fn: F, ms: number): (...args: Parameters) => void => { - let timer: ReturnType +export function debounce) => ReturnType>( + fn: F, + ms: number +): (...args: Parameters) => void { + let timer: ReturnType - return (...args: Parameters) => { - clearTimeout(timer) - timer = setTimeout(() => fn(...args), ms) - } - } + return (...args) => { + clearTimeout(timer) + timer = setTimeout(() => fn(...args), ms) + } +}