# fizz-event-bus

> a js event bus for simple sence.

Latest version **1.1.1** (published 2019-01-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install fizz-event-bus
pnpm add fizz-event-bus
yarn add fizz-event-bus
bun add fizz-event-bus
```

## 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.1.1 |
| Published | 2019-01-16 |
| First published | 2017-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | fizzstack@gmail.com |
| Maintainers | hifizz |
| Keywords | emitter, eventbus, pub/sub, onemit |

## Links

- npm: https://www.npmjs.com/package/fizz-event-bus
- Repository: https://github.com/hifizz/event-bus
- Homepage: https://github.com/hifizz/event-bus#readme
- Issues: https://github.com/hifizz/event-bus/issues
- npm.io page: https://npm.io/package/fizz-event-bus

## 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.1 (latest) — 2019-01-16
- 1.1.0 — 2018-06-26
- 1.0.0 — 2018-06-10
- 0.0.4 — 2018-06-07
- 0.0.3 — 2017-09-12
- 0.0.2 — 2017-08-26
- 0.0.1 — 2017-08-26

## README

# Event bus

[![Build Status](https://travis-ci.org/hifizz/event-bus.svg?branch=master)](https://travis-ci.org/hifizz/event-bus)
[![codecov](https://codecov.io/gh/hifizz/event-bus/branch/master/graph/badge.svg)](https://codecov.io/gh/hifizz/event-bus)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

A minimalism but expressive event bus for JS pub/sub scene.
Just for simple scene.
You can add your own feature free.

## Browsers support

| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari-ios/safari-ios_48x48.png" alt="iOS Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>iOS Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IE8, IE9, IE10, IE11, Edge                                                                                                                                                                                      | last 10 versions                                                                                                                                                                                                  | last 10 versions                                                                                                                                                                                              | last 2 versions                                                                                                                                                                                               | last 2 versions                                                                                                                                                                                                               | last 2 versions                                                                                                                                                                                           |

## Install

```bash
yarn add fizz-event-bus --save
```

## Usage

```tsx
import eventBus from "fizz-event-bus";
// ES3 兼容
// import eventBus from "fizz-event-bus/lib/es3/index";

function hander(param) {
  console.log(param);
}

eventBus.on("foo", handler);

// somewhere after import from 'fizz-event-bus'
eventBus.emit("foo", "bar");
```

As default, eventBus is a global object. But you can import the eventBus constructor for create a new EventBus or inherit it.

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