1.0.2 • Published 4 years ago

emit-machine v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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