0.1.1 • Published 8 months ago

@1ohooks/use-swipe v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago
  • onSwipeLeft (function): A callback function to be executed when a swipe left gesture is detected.
  • onSwipeRight (function): A callback function to be executed when a swipe right gesture is detected.
  • onSwipeUp (function): A callback function to be executed when a swipe up gesture is detected.
  • onSwipeDown (function): A callback function to be executed when a swipe down gesture is detected.
  • threshold (number): The minimum swipe distance required to trigger a swipe action (default is 50 pixels).
  • maxDuration (number): The maximum duration (in milliseconds) for a swipe gesture to be recognized (default is 500 milliseconds).
  • preventDefault (boolean): Whether to prevent the default behavior of touch events (default is false).

Here's an example of how to use useSwipe in your component:

0.1.1

8 months ago

0.1.0

8 months ago