tiny-emitter-singleton
v1.0.0
Published
A tiny emitter for web applications.
Downloads
2
Readme
Tiny Emitter Singleton
2020-04-02
A tiny emitter for web applications.
You can use it to make different modules communicate with each other via events.
Install
npm install tiny-emitter-singleton
Usage
In script 1, do this:
const ee = require('tiny-emitter-singleton');
ee.dispatch("removeBtnClicked", "any param", "any param2");
In script 2, do this:
const ee = require('tiny-emitter-singleton');
ee.on("removeBtnClicked", (...args) => {
console.log("removeBtnClicked", ...args);
});
History Log
1.0.0 -- 2020-04-02
- initial commit