Skip to content

Commit f2e26a0

Browse files
authored
fix(useDebouncedCallback): fix return type (#85)
1 parent 77e267b commit f2e26a0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/useDebouncedCallback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import useTimeout from './useTimeout'
1010
*/
1111
export default function useDebouncedCallback<
1212
TCallback extends (...args: any[]) => any
13-
>(fn: TCallback, delay: number): TCallback {
13+
>(fn: TCallback, delay: number): (...args: Parameters<TCallback>) => void {
1414
const timeout = useTimeout()
1515
return useCallback(
1616
(...args: any[]) => {
@@ -19,5 +19,5 @@ export default function useDebouncedCallback<
1919
}, delay)
2020
},
2121
[fn, delay],
22-
) as any
22+
)
2323
}

0 commit comments

Comments
 (0)