# vue-super-eventbus

> An enhanced component of Vue event bus can be automatically destroyed without manual cancellation of subscription events, modularization, immutability of event data and many other features.

Latest version **2.4.1** (published 2019-11-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-super-eventbus
pnpm add vue-super-eventbus
yarn add vue-super-eventbus
bun add vue-super-eventbus
```

## 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 | 2.4.1 |
| Published | 2019-11-27 |
| First published | 2019-07-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Liu Wei |
| Maintainers | xygahs0801 |
| Keywords | vue, eventbus |

## Links

- npm: https://www.npmjs.com/package/vue-super-eventbus
- Repository: https://github.com/xygahs0801/vue-super-eventbus
- Homepage: https://github.com/xygahs0801/vue-super-eventbus#readme
- Issues: https://github.com/xygahs0801/vue-super-eventbus/issues
- npm.io page: https://npm.io/package/vue-super-eventbus

## 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

- 2.4.1 (latest) — 2019-11-27
- 2.4.0 — 2019-11-21
- 2.3.0 — 2019-11-21
- 2.1.1 — 2019-11-19
- 2.0.0 — 2019-11-19
- 1.1.0 — 2019-11-19
- 1.0.8 — 2019-11-18
- 1.0.7 — 2019-11-18
- 1.0.6 — 2019-11-18
- 1.0.5 — 2019-09-16
- 1.0.4 — 2019-07-22
- 1.0.3 — 2019-07-19
- 1.0.2 — 2019-07-19
- 1.0.1 — 2019-07-19
- 1.0.0 — 2019-07-18

## README

- [vue-super-eventbus](#vue-super-eventbus)
  - [Install](#install)
  - [Usage](#usage)
    - [On Vue entry](#on-vue-entry)
    - [In Vue component](#in-vue-component)
    - [In other Vue component](#in-other-vue-component)
# vue-super-eventbus
An enhanced component of Vue event bus can be automatically destroyed without manual cancellation of subscription events, modularization, immutability of event data and many other features.

## Install
``` shell
npm i --save vue-super-eventbus
```

## Usage
### On Vue entry
``` javascript
import EventBus from "vue-super-eventbus"
Vue.use(EventBus)
```
### In Vue component
``` javascript
// Recommend
on:{
  event1(data){
    // handle data
    console.log(data)
  },
  event2(data){
    // handle data
    console.log(data)
  }
},
// Or
created() {
  this.$bus.on(this, "event1", data => {
    // handle data
    console.log(data);
  });
  this.$bus.on(this, "event2", data => {
    // handle data
    console.log(data);
  });
},
```
### In other Vue component
``` javascript
created() {
  this.$bus
    .emit("event1", 'test message')
    .emit("event2", { message: "test json message" });
}
beforeDestroy() {
  // No need to off the event, The lib take care of this for you.
}
```

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