UseOnDeviceOrientation
katanakit-js / useOnDeviceOrientation
Function: useOnDeviceOrientation()
Section titled “Function: useOnDeviceOrientation()”function useOnDeviceOrientation(callback): (() => void) | null;Defined in: infrastructure/sensors/sensors.service.ts:229
Listens for device orientation events (compass heading, tilt).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
callback |
(event) => void |
Called with each DeviceOrientationEvent. |
Returns
Section titled “Returns”(() => void) | null
A cleanup function that removes the listener, or null if unavailable.
Example
Section titled “Example”const off = useOnDeviceOrientation((e) => { console.log("Alpha:", e.alpha);});