emit-machine
v1.0.2
Published
Simple event emitter for any js platform
Downloads
5
Maintainers
Readme
About
Simple event emitter for any js platform
Install
npm i emit-machine
Usage
const EventEmitter = require('emit-machine');
const emitter = new EventEmitter;
// subscribtion to specified event
emitter.on('your_event', event => {
console.log(event);
});
// sending data to subscribed callback functions
emitter.emit('your_event', { type: 'your_event', data: 1 });