# @zhishaofei3/eventdispatcher

> A classics event dispatcher

Latest version **1.1.4** (published 2021-07-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install @zhishaofei3/eventdispatcher
pnpm add @zhishaofei3/eventdispatcher
yarn add @zhishaofei3/eventdispatcher
bun add @zhishaofei3/eventdispatcher
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2021-07-29 |
| First published | 2020-05-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | zhishaofei3 |
| Maintainers | zhishaofei3 |
| Keywords | event, events, fire, eventListener, dispatchEvent |

## Links

- npm: https://www.npmjs.com/package/@zhishaofei3/eventdispatcher
- Repository: https://github.com/zhishaofei3/EventDispatcher
- Homepage: https://github.com/zhishaofei3/EventDispatcher#readme
- Issues: https://github.com/zhishaofei3/EventDispatcher/issues
- npm.io page: https://npm.io/package/@zhishaofei3/eventdispatcher

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.1.4 (latest) — 2021-07-29
- 1.1.3 — 2020-08-19
- 1.1.2 — 2020-05-30
- 1.1.1 — 2020-05-30
- 1.1.0 — 2020-05-30
- 1.0.5 — 2020-05-30
- 1.0.4 — 2020-05-11
- 1.0.3 — 2020-05-11
- 1.0.2 — 2020-05-08
- 1.0.1 — 2020-05-08
- 1.0.0 — 2020-05-08

## README

## ES6 EventDispatcher

**Code Example**
```javascript
import EventDispatcher from "@zhishaofei3/eventdispatcher"

class MyClass extends EventDispatcher {
}

const myClass  = new MyClass()

function onEventHandler() {
}

// API
myClass.addEventListener('eventName', onEventHandler)
myClass.hasEventListener('eventName', onEventHandler) // true
myClass.dispatchEvent({type: 'eventName'})
myClass.dispatchEvent({type: 'eventName', moreData: {}})
myClass.removeEventListener('eventName', onEventHandler)
myClass.removeAllEventListener()
```

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