import { onDeviceMotionChange, offDeviceMotionChange, stopDeviceMotionListening } from '@ray-js/ray'
// Cancel orientation listener: register a listener first, then pass the same listener to cancel precisely.
// Use the success callback of stopDeviceMotionListening at the end as the test case completion signal
// (off removes the listener group; TTT needs an explicit callback to determine when the case ends).
const listener = e => console.log(e);
onDeviceMotionChange(listener);
offDeviceMotionChange(listener);
stopDeviceMotionListening({
success: () => console.log("offDeviceMotionChange done"),
fail: error => console.error(error),
});