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