---
name: "offAppEvent"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.4.2" }
title: "ty.offAppEvent - Remove listener for dashboard tap event"
---

## offAppEvent

> [VERSION] Base Library >= 2.4.2

### Description

Cancel listening to the dashboard click event

### Parameters

`(callback: Function)`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `callback` | `(params: Record<string, unknown>) => void` | Yes | Mini Program custom event callback |

### Return Value

None


### Examples

#### Stop listening for app custom events

```js
Page({
  data: {
    handler: null,
  },
  onLoad() {
    this.data.handler = (params) => {
      console.log('Received app event', params);
    };
    ty.onAppEvent(this.data.handler);
  },
  onUnload() {
    ty.offAppEvent(this.data.handler);
  },
});
```
