# @antv/event-emitter

> event emitter for antvis.

Latest version **0.1.3** (published 2022-02-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @antv/event-emitter
pnpm add @antv/event-emitter
yarn add @antv/event-emitter
bun add @antv/event-emitter
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2022-02-10 |
| First published | 2019-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Maintainers | rainy25ghz, zeyuwang, yanxiong, susiwen8, freestyle21, soundquiet, elaine.q.10, sturuby, lviser, sakuya223, serializedowen, xdzhao, yangzhanmei, wjgogogo, leungwensen, dori, iaaron, yard, simaq, dxq613, intchous, susan_ann, jinke.li, lzxue, army8735, atool, baizn, dengfuping, neoddish, jeffy2012, zqlu, afc163, pomelo-nwu, kopiluwaky, ccnuzindex, panyuqi, bubkoo, zengyue, kasmine, boyu.zlj, l1ud0ngq1, newbyvector, winniexing, chenluli, kn9117, xdddst, semious2020, esora, nadia_liu, bbsqq, mxz96102, openwayne, pearmini, pddpd, yiqianyao, zhanba, cxxxxxn |

## Links

- npm: https://www.npmjs.com/package/@antv/event-emitter
- Repository: https://github.com/antvis/event-emitter
- Homepage: https://github.com/antvis/event-emitter#readme
- Issues: https://github.com/antvis/event-emitter/issues
- npm.io page: https://npm.io/package/@antv/event-emitter

## Recent versions

- 0.1.3 (latest) — 2022-02-10
- 0.1.2 — 2020-04-01
- 0.1.1 — 2019-10-21
- 0.1.0 — 2019-07-19

## README

# @antv/event-emitter

> event-emitter for @antvis.



## Install

> npm i --save @antv/event-emitter



## Usage

```js
import EE from '@antv/event-emitter';

const ee = new EE();

ee.on('mouseover', () => {});

ee.once('click', () => {});

ee.on('*', () => {});

ee.emit('click', 1, 'hello', true);

ee.off('click');
```



## API

Simple and similar with `event-emitter`.


 - `on(evt: string, callback: Function)`: listen an event.
 - `once(evt: string, callback: Function)`: listen a event only once.
 - `emit(evt: string, ...parameters: any[])`: emit / trigger an event with parameters.
 - `off(evt?: string, callback?: Function)`: unsubscribe an event.
 - `getEvents()`: get all the exist events.

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