# @wxmini/event

> 解决小程序页面组件间事件通信问题。

Latest version **1.0.1** (published 2019-02-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install @wxmini/event
pnpm add @wxmini/event
yarn add @wxmini/event
bun add @wxmini/event
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-02-04 |
| First published | 2019-02-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | goumang2010 |

## Links

- npm: https://www.npmjs.com/package/@wxmini/event
- npm.io page: https://npm.io/package/@wxmini/event

## Recent versions

- 1.0.1 (latest) — 2019-02-04

## README

# 事件广播 API
解决小程序页面组件间事件通信问题。

## API

- on(eventName, callback)
    注册一个事件监听

- emit(eventName)
    触发一个事件

- off(eventName, callback)
    移除一个事件监听

- Event
    构造函数，新建一个事件

## 使用事例

```js
import event from '@wxmini/event';

event.on('login', () => {
    // fn content
});

event.emit('login'); 
        
event.off('login', () => {
    // fn content
});
```

---
_Source: https://npm.io/package/@wxmini/event · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
