From 69754bf38215caa948bce275425c8215294a3927 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Wed, 9 Sep 2020 10:25:09 +0200 Subject: [PATCH] F #3951: Remove debounce function (#193) --- src/fireedge/src/public/utils/helpers.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/fireedge/src/public/utils/helpers.js b/src/fireedge/src/public/utils/helpers.js index a683912db1..94cab89185 100644 --- a/src/fireedge/src/public/utils/helpers.js +++ b/src/fireedge/src/public/utils/helpers.js @@ -1,18 +1 @@ export const fakeDelay = ms => new Promise(resolve => setTimeout(resolve, ms)); - -export const debounce = (func, delay, immediate) => { - let timerId; - return (...args) => { - const boundFunc = func.bind(this, ...args); - clearTimeout(timerId); - if (immediate && !timerId) { - boundFunc(); - } - const calleeFunc = immediate - ? () => { - timerId = null; - } - : boundFunc; - timerId = setTimeout(calleeFunc, delay); - }; -};