JSPM

really-small-events

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 970
  • Score
    100M100P100Q111323F
  • License MIT

A Tiny Typescript Event Library

Package Exports

  • really-small-events

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (really-small-events) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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