tiny-emitter-singleton

1.0.0 • Public • Published

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

/tiny-emitter-singleton/

    Package Sidebar

    Install

    npm i tiny-emitter-singleton

    Weekly Downloads

    0

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    1.79 kB

    Total Files

    3

    Last publish

    Collaborators

    • lingtalfi