@fluent-windows/hooks
Version:
Fluent-Windows React hooks.
19 lines (18 loc) • 447 B
TypeScript
/**
* 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;