---
name: "offGyroscopeChange"
mode: "kit"
versionRequirements:
  - { name: "BaseKit", version: "2.3.2" }
  - { name: "@ray-js/ray", version: "0.3.23" }
platform:
  - "iOS"
  - "Android"
async: true
---

## offGyroscopeChange

> [VERSION] BaseKit >= 2.3.2 | @ray-js/ray >= 0.3.23

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Stop listening for gyroscope data changes.

### Parameters

`(listener: Function)`

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `listener` | `(params: Object) => void` | Yes | - |  |

##### offGyroscopeChange.listener(params) properties

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `x` | `number` | Yes | - | `2.3.2` | X-axis |
| `y` | `number` | Yes | - | `2.3.2` | Y-axis |
| `z` | `number` | Yes | - | `2.3.2` | Z-axis |


### Examples

#### Demo

```tsx
import { onGyroscopeChange, startGyroscope, offGyroscopeChange } from '@ray-js/ray'

// Stop listening to the gyroscope: set up with onGyroscopeChange + startGyroscope, then cancel via offGyroscopeChange
onGyroscopeChange(e => console.log(e));
startGyroscope({
  interval: "normal",
  success: () => {},
  fail: error => console.error(error),
});
offGyroscopeChange(
  () => console.log("Stopped listening to gyroscope"),
  error => console.error(error)
);
```
