1.2.3 • Published 6 years ago

@nodeart/event_emitter v1.2.3

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

bitHound Overall Score bitHound Dependencies bitHound Code

Methods:

const EventEmitter = require('@nodeart/event_emitter');
const events = new EventEmitter();
events.on('eventName', ...fns)
      .once('eventName', ...fns)
      .off('eventName', ...fns)
      .emit('eventName', {
          ctx: true
      }, ...args)
      .times('eventName2', 3, ...fns)
      .offAll();

const inherited = {};

// reset prototype
EventEmitter
    .inherit(inherited)
    .on('smth', ...fns);
    
const extended = {};

// add EventEmitter functionality as mixin
EventEmitter
    .extend(extended)
    .on('smth', ...fns);

// One can remove some functions from listeners array by passing them to .off method,
// but to remove all listeners event use .off with eventName only;
1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago