Skip to content

Commit 542e8ed

Browse files
fix: throttleの構造見直し
1 parent 685e088 commit 542e8ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.vitepress/scripts/throttle.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ export function useThrottle<F extends (...args: any) => void>(fn: F, delay: numb
33
let isFirst = true;
44
return function (...args: Parameters<F>) {
55
if (timer) {
6-
return;
6+
clearTimeout(timer);
7+
timer = null;
78
}
89
if (isFirst) {
910
fn(...args);

0 commit comments

Comments
 (0)