useVibrate ​
Hook that provides vibrate api
typescript
import { useVibrate } from '@siberiacancode/reactuse';
Usage ​
typescript
const { supported, active, vibrate, stop, pause, resume } = useVibrate(1000);
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
options.pattern | UseVibratePattern | - | The pattern for vibration |
options.interval? | number | 0 | Time in milliseconds between vibrations |