web-api-hooks
Version:
Essential set of React Hooks for convenient Web API consumption.
14 lines (13 loc) • 355 B
TypeScript
import { EventArgs } from './types';
/**
* Tracks physical orientation of the device.
*
* @returns Own properties of the last corresponding event.
*
* @example
* function Component() {
* const { alpha, beta, gamma } = useDeviceOrientation();
* // ...
* }
*/
export default function useDeviceOrientation(): EventArgs<DeviceOrientationEvent>;