Skip to content

Commit 0f3200c

Browse files
committed
docs(use-double-tap): Add JSDoc to hook definition
1 parent 3f35220 commit 0f3200c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/use-double-tap/src/lib/use-double-tap.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { MouseEvent, useCallback, useRef } from 'react';
22
import { CallbackFunction, DoubleTapCallback, DoubleTapOptions, DoubleTapResult } from './use-double-tap.types';
33

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+
*/
410
export function useDoubleTap<Target = Element, Callback extends DoubleTapCallback<Target> = DoubleTapCallback<Target>>(
511
callback: Callback,
612
threshold = 300,

0 commit comments

Comments
 (0)