Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private useLongUpdateInterval() {
Gyroscope.setUpdateInterval(1000);
}
private useShortUpdateInterval() {
const framesPerSecond = 60;
Gyroscope.setUpdateInterval(1000 / framesPerSecond);
}
useEffect(() => {
if (availability) {
Gyroscope.isAvailableAsync().then(setAvailable);
}
if (options.interval !== undefined) {
Gyroscope.setUpdateInterval(options.interval);
}
return Gyroscope.addListener(setData).remove;
}, []);