Skip to content

xpodev/eventee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eventee

Eventee is an extended version of the EventEmitter class from Node.js. It allows you to stop the propagation of events.

Installation

npm install eventee

Usage

The usage is the same as the EventEmitter class from Node.js. The only difference is that you can stop the propagation of events by returning false in the event handler.

const { EventEmitter } = require('eventee');

const emitter = new EventEmitter();

emitter.on('event', () => {
    console.log('Event 1');
});

emitter.on('event', () => {
    console.log('Event 2');
    return false;
});

emitter.on('event', () => {
    // This event will not be called
    console.log('Event 3');
});

emitter.emit('event');

Future plans

  • Add support for event priorities

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published