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 3f35220 commit 0f3200cCopy full SHA for 0f3200c
1 file changed
packages/use-double-tap/src/lib/use-double-tap.ts
@@ -1,6 +1,12 @@
1
import { MouseEvent, useCallback, useRef } from 'react';
2
import { CallbackFunction, DoubleTapCallback, DoubleTapOptions, DoubleTapResult } from './use-double-tap.types';
3
4
+/**
5
+ * @param callback - The function to be called on a double tap event.
6
+ * @param threshold - The time in milliseconds that defines the interval between single taps for them to be considered a double tap. Default is 300 ms.
7
+ * @param options - An object containing optional callbacks for single tap and other configurations.
8
+ * @return An object with an onClick handler if a callback is provided, otherwise an empty object.
9
+ */
10
export function useDoubleTap<Target = Element, Callback extends DoubleTapCallback<Target> = DoubleTapCallback<Target>>(
11
callback: Callback,
12
threshold = 300,
0 commit comments