How to use the expo-sensors.Gyroscope.addListener function in expo-sensors

To help you get started, we’ve selected a few expo-sensors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github byCedric / use-expo / packages / sensors / src / use-gyroscope.ts View on Github external
useEffect(() => {
		if (availability) {
			Gyroscope.isAvailableAsync().then(setAvailable);
		}

		if (options.interval !== undefined) {
			Gyroscope.setUpdateInterval(options.interval);
		}

		return Gyroscope.addListener(setData).remove;
	}, []);
github janaagaard75 / expo-and-typescript / src / GyroscopeScreen.tsx View on Github external
private subscribe() {
    this.subscription = Gyroscope.addListener(result => {
      this.setState({ gyroscopeData: result });
    });
  }