Registers a callback to be invoked when the device orientation changes.
Uses the Screen Orientation API. Returns an object with a stop method to remove the listener.
Parameters
callback: (type:string,angle:number)=>void
Function to call with the orientation type and angle.
Returns undefined|{stop:()=>void}
An object with a stop method to remove the event listener, or undefined if not supported.
Example: Imports
// ES Module import { onOrientationChange } from'@bnidev/js-utils'
Registers a callback to be invoked when the device orientation changes. Uses the Screen Orientation API. Returns an object with a
stop
method to remove the listener.