UNPKG

@fluent-windows/hooks

Version:
19 lines (18 loc) 447 B
/** * Subscribe to touch events based on `onTouchStart`, `onTouchEnd` * * Demo * import { useTouch } from '@fluent-windows/hooks' * * function handleChange() { * // ... * } * const [status, bind] = useTouch(handleChange) * * <button {...bind}>{status}</button> */ declare function useTouch(statusHandler?: (status: boolean) => void): [boolean, { onTouchStart: () => void; onTouchEnd: () => void; }]; export default useTouch;