UNPKG

web-api-hooks

Version:

Essential set of React Hooks for convenient Web API consumption.

14 lines (13 loc) 368 B
import { EventArgs } from './types'; /** * Tracks acceleration and rotation rate of the device. * * @returns Own properties of the last corresponding event. * * @example * function Component() { * const { acceleration, rotationRate, interval } = useDeviceMotion(); * // ... * } */ export default function useDeviceMotion(): EventArgs<DeviceMotionEvent>;