File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default function useThrottleFn<T extends any[]>(
30
30
const timer = useRef < ReturnType < typeof setTimeout > > ( ) ;
31
31
const fnRef = useRef ( fn ) ;
32
32
const optionsRef = useRef < ThrottleFnOptions | undefined > ( options ) ;
33
- const currentArgs = useRef < any > ( ) ;
33
+ const currentArgs = useRef < T > ( ) ;
34
34
35
35
fnRef . current = fn ;
36
36
optionsRef . current = options ;
@@ -55,7 +55,7 @@ export default function useThrottleFn<T extends any[]>(
55
55
} , wait ) ;
56
56
} else {
57
57
timer . current = setTimeout ( ( ) => {
58
- fnRef . current ( ...currentArgs . current ) ;
58
+ fnRef . current ( ...( currentArgs . current as T ) ) ;
59
59
timer . current = undefined ;
60
60
} , wait ) ;
61
61
}
@@ -69,7 +69,7 @@ export default function useThrottleFn<T extends any[]>(
69
69
return ;
70
70
}
71
71
72
- fnRef . current ( ...currentArgs . current ) ;
72
+ fnRef . current ( ...( currentArgs . current as T ) ) ;
73
73
cancel ( ) ;
74
74
} , [ cancel ] ) ;
75
75
You can’t perform that action at this time.
0 commit comments