# dispatchyo

> extremely simple blazing-fast pure javascript publisher-subscriber

Latest version **1.0.0** (published 2016-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install dispatchyo
pnpm add dispatchyo
yarn add dispatchyo
bun add dispatchyo
```

## 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.0.0 |
| Published | 2016-01-25 |
| First published | 2016-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | a-wart |
| Maintainers | jetradar |
| Keywords | dispatcher, events, subscribe, publish, pub-sub, pub, sub, dispatch, trigger, handle, on |

## Links

- npm: https://www.npmjs.com/package/dispatchyo
- Repository: https://github.com/jetradar/dispatcher
- Homepage: https://github.com/jetradar/dispatcher#readme
- Issues: https://github.com/jetradar/dispatcher/issues
- npm.io page: https://npm.io/package/dispatchyo

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-01-25

## README

# dispatcher
extremely simple blazing-fast pure javascript publisher-subscriber

## Installation
`npm install balabol --save`

## Examples
```javascript
import { dispatcher } from 'balabol';

dispatcher.on('beer', (eventName, data) => {
  console.log(data.isDraught);
…
}

dispatcher.send('beer', {
  isDraught: true
});

dispatcher.trigger('beer', {
  isDraught: false
});

// true
// false

```

## API Reference

`dispatcher.on(eventName, handler)` — subscribes handler to eventName

`dispatcher.trigger(eventName, payload)` or `dispatcher.send(eventName, payload)` — Fires `eventName` event to all

`dispatcher.on('all', handler)` — subscribes for all the events being fired

`dispatcher.off(eventName)` — removes eventName from events list

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