1.0.0 • Published 6 years ago
@gotoeasy/bus v1.0.0
@gotoeasy/bus
simple event bus
Install
npm i @gotoeasy/busAPI
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 eventsLinks
npm-packageshttps://github.com/gotoeasy/npm-packages