diff --git a/src/common/util/debounce.ts b/src/common/util/debounce.ts index cd61f072b95d..ec96fa63eb56 100644 --- a/src/common/util/debounce.ts +++ b/src/common/util/debounce.ts @@ -3,7 +3,7 @@ // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the -// leading edge, instead of the trailing. +// leading edge and on the trailing. export const debounce = ( func: (...args: T) => void, @@ -14,9 +14,7 @@ export const debounce = ( const debouncedFunc = (...args: T): void => { const later = () => { timeout = undefined; - if (!immediate) { - func(...args); - } + func(...args); }; const callNow = immediate && !timeout; clearTimeout(timeout);