Skip to content

Commit 63741ed

Browse files
committed
Simplifies old syncronous debouncing function
(#3543, #3684)
1 parent 9e3445c commit 63741ed

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/system/function.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export function debounce<T extends (...args: any[]) => ReturnType<T>>(
8686

8787
function debounced(this: any, ...args: Parameters<T>) {
8888
const time = Date.now();
89-
const isInvoking = shouldInvoke(time);
9089

9190
if (aggregator != null && lastArgs) {
9291
lastArgs = aggregator(lastArgs, args);
@@ -98,13 +97,6 @@ export function debounce<T extends (...args: any[]) => ReturnType<T>>(
9897
lastThis = this;
9998
lastCallTime = time;
10099

101-
if (isInvoking) {
102-
if (timer == null) {
103-
// Start the timer for the trailing edge.
104-
timer = setTimeout(timerExpired, wait);
105-
return result;
106-
}
107-
}
108100
if (timer == null) {
109101
timer = setTimeout(timerExpired, wait);
110102
}

0 commit comments

Comments
 (0)