vue-ear
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

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

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');

Readme

Keywords

Package Sidebar

Install

npm i vue-ear

Weekly Downloads

2

Version

1.3.1

License

MIT

Unpacked Size

12.6 kB

Total Files

6

Last publish

Collaborators

  • trapcode