We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 857cce7 commit 0ab3324Copy full SHA for 0ab3324
apps/webapp/app/hooks/useDebounce.ts
@@ -1,6 +1,11 @@
1
import { useRef } from "react";
2
3
-//a function that you call with a debounce delay, the function will only be called after the delay has passed
+/**
4
+ * A function that you call with a debounce delay, the function will only be called after the delay has passed
5
+ *
6
+ * @param fn The function to debounce
7
+ * @param delay In ms
8
+ */
9
export function useDebounce<T extends (...args: any[]) => any>(fn: T, delay: number) {
10
const timeout = useRef<ReturnType<typeof setTimeout>>();
11
0 commit comments