diff --git a/packages/comment-widget/src/utils/debounce.ts b/packages/comment-widget/src/utils/debounce.ts deleted file mode 100644 index 0972fda..0000000 --- a/packages/comment-widget/src/utils/debounce.ts +++ /dev/null @@ -1,19 +0,0 @@ -export function debounce(func: Function, delay: number, immediate: boolean = false): Function { - let timer: number | undefined; - - return function (this: unknown, ...args: never[]) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const context = this; - if (immediate) { - func.apply(context, args); - immediate = false; - return; - } - clearTimeout(timer); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - timer = setTimeout(() => { - func.apply(context, args); - }, delay); - }; -}