@gotoeasy/bus

1.0.0 • Public • Published

@gotoeasy/bus

simple event bus

NPM version License

Install

npm i @gotoeasy/bus

API

const bus = require('@gotoeasy/bus');

bus.on('input', function(txt){
    console.log('input ...', txt);
})
bus.once('once', function(txt){
    console.log('once ...', txt);
})

bus.at('input', 'abc'); // input ... abc

bus.at('once', '123'); // once ... 123
bus.at('once', '123'); // do nothing

bus.off('input');
bus.at('input', 'abc'); // do nothing

bus.clear();            // clear all events


Links

Package Sidebar

Install

npm i @gotoeasy/bus

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

5.68 kB

Total Files

5

Last publish

Collaborators

  • rpose