irrelon-emitter

2.1.4 • Public • Published

Irrelon Emitter

Version 2.1.4

Usage

Browser

Include the ./dist/index.min.js file in your HTML

<script src="./dist/index.min.js"></script>

Node.js

Install via NPM:

npm install irrelon-emitter

Include in your application:

var Emitter = require('irrelon-emitter');

Add Emitter Functionality to Existing Class

Given an example class:

var MyClass = function () {
    this.emit('myEvent', myData, myOtherData);
};

Add emitter functionality:

Emitter(MyClass);

Your class now inherits the emitter methods:

  • on
  • off
  • once
  • emit
  • emitId
  • emitStatic
  • emitStaticId
  • cancelStatic
  • deferEmit
  • willEmit

/irrelon-emitter/

    Package Sidebar

    Install

    npm i irrelon-emitter

    Weekly Downloads

    16

    Version

    2.1.4

    License

    none

    Unpacked Size

    1.2 MB

    Total Files

    50

    Last publish

    Collaborators

    • coolblok1324
    • coolbloke1324