An open API service indexing awesome lists of open source software.

https://github.com/trapcodeio/vue-ear

Simple fun to use vue event bus class for generating as many event listeners as you want.
https://github.com/trapcodeio/vue-ear

Last synced: 8 months ago
JSON representation

Simple fun to use vue event bus class for generating as many event listeners as you want.

Awesome Lists containing this project

README

          

## Vue Ear

A library that makes vue events fun to use.
Talk to any component from any component

#### Install Using Npm
```
npm install vue-ear
```

#### Install Using Yarn
```
yarn add install vue-ear
```

####
This doc is incomplete for now..

#### Example
```javascript
import VueEar from "vue-ear";

let userEvents = new VueEar('user');
let sideBarEvents = new VueEar('sidebar');

sideBarEvents.on('hide', ()=>{
// Hide Side Bar
})

userEvents.on('logoutWasClicked', ()=>{
// Hide Side bar
sideBarEvents.emit('hide');
// or talk to sidebar from anywhere in your app.
userEvents.talkTo('sidebar', 'hide');
})

// Triggers the user logoutWasClicked event
sideBarEvents.talkTo('user', 'logoutWasClicked');
```