1.0.0 • Published 4 years ago

tiny-emitter-singleton v1.0.0

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

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