We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 685e088 commit 542e8edCopy full SHA for 542e8ed
.vitepress/scripts/throttle.ts
@@ -3,7 +3,8 @@ export function useThrottle<F extends (...args: any) => void>(fn: F, delay: numb
3
let isFirst = true;
4
return function (...args: Parameters<F>) {
5
if (timer) {
6
- return;
+ clearTimeout(timer);
7
+ timer = null;
8
}
9
if (isFirst) {
10
fn(...args);
0 commit comments