really-small-events
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

really-small-events

A Tiny Typescript Event Library

Just over 300 bytes gzipped. :)

Installation

npm i really-small-events --save 

Usage

Typescript / Babel

import { RSE } from "really-small-events";

NodeJS

const RSE = require("really-small-events").RSE;

API

Listen for events

const runThisFunc = (as, many, args, as, I, want) => {
    console.log("Hello, world!");
};
 
// Listen for Event
RSE.on("someEvent", runThisFunc)
 
// Trigger event anywhere in your app
RSE.trigger("someEvent", the, args, to, pass, to, the, event);
 
// Remove listener
RSE.off("someEvent", runThisFunc);

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i really-small-events

    Weekly Downloads

    1,540

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • clicksimply