v-hub

1.0.0 • Public • Published

v-hub

A vue plugin working as event bus.

Install

yarn add v-hub

# or
npm install --save v-hub

Import

// import
import vHub from 'v-hub';
Vue.use(vHub);

// use
created() {
  this.$hub.on('EVENT_NAME', () => {
    // ...
  });
},
destroy() {
  this.$hub.off();
}

API

  • .on
  • .once
  • .emit
  • .off

Readme

Keywords

none

Package Sidebar

Install

npm i v-hub

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • wemlion