Skip to content

Commit cb71021

Browse files
committed
streamline debounce code
1 parent d361a1a commit cb71021

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/replay/src/util/debounce.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ export function debounce(func: CallbackFunction, wait: number, options?: Debounc
5858
timerId = setTimeout(invokeFunc, wait);
5959

6060
if (maxWait && maxTimerId === undefined) {
61-
maxTimerId = setTimeout(() => {
62-
invokeFunc();
63-
if (timerId) {
64-
clearTimeout(timerId);
65-
}
66-
}, maxWait);
61+
maxTimerId = setTimeout(invokeFunc, maxWait);
6762
}
6863

6964
return callbackReturnValue;

0 commit comments

Comments
 (0)