From 616118b6d8729ff5da7f8b49f43a79659d9707b4 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Thu, 20 Jun 2024 15:57:34 -0500 Subject: [PATCH] [PM-5189] Removing custom debounce method that is unused --- apps/browser/src/autofill/utils/index.ts | 25 ------------------------ 1 file changed, 25 deletions(-) diff --git a/apps/browser/src/autofill/utils/index.ts b/apps/browser/src/autofill/utils/index.ts index ef30460c71..08ce1314b5 100644 --- a/apps/browser/src/autofill/utils/index.ts +++ b/apps/browser/src/autofill/utils/index.ts @@ -347,28 +347,3 @@ export function throttle(callback: () => void, limit: number) { } }; } - -/** - * Debounces a callback function to run after a certain amount of time has passed. - * - * @param callback - The callback function to debounce. - * @param wait - The time in milliseconds to wait before running the callback. - * @param immediate - Determines whether the callback should run immediately. - */ -export function debounce(callback: () => void, wait: number, immediate?: boolean) { - let timeoutId: NodeJS.Timeout | number | null = null; - - return (...args: unknown[]) => { - if (immediate && !timeoutId) { - callback.apply(this, args); - } - - if (timeoutId) { - globalThis.clearTimeout(timeoutId); - } - timeoutId = globalThis.setTimeout(() => { - callback.apply(this, args); - timeoutId = null; - }, wait); - }; -}