lite-ee

1.1.1 • Public • Published

lite-ee

An ultralite es6 event emitter with on, once, off, and emit

npm i --save lite-ee
  • on('event', (...args) => {}) => this
  • once('event', (...args) => {}) => this
  • off('event'[, handler]) => this
  • emit('event', ...args) => void

Mixin

Need to add event emitting, but already extending another class? Use the handy mixin! All the same functionality without needing to extend LiteEventEmitter.

import mixin from 'lite-ee/mixin';
// OR const mixin = require('lite-ee/mixin');
 
class MyClass extends mixin(TheirClass) {
    // Then do everything like you normally would, except now you also have event emitters!
}

Readme

Keywords

Package Sidebar

Install

npm i lite-ee

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

5.98 kB

Total Files

7

Last publish

Collaborators

  • justmaier