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) {
Pedometer.isAvailableAsync().then(setAvailable);
}
return Pedometer.watchStepCount(setData).remove;
}, []);
onPress={async () => {
this.listener = Pedometer.watchStepCount(data => {
this.setState({ stepCount: data.steps });
});
}}
title="Listen for step count updates"