Skip to content

Jenesius/event-emitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

event-emitter

Simple, small and with off-hook.

Global usign

import EventEmitter from "jenesius-event-emitter";

const offMessage = EventEmitter.on('message', m => {});

EventEmitter.emit('message', 'simple');

// If handler not needed:
offMessage();

Extends using

class Test extends EventEmitter {
    // ...
}
const test = new Test()
test.on('message', () => {})

test.emit('message');

or

const a = new EventEmitter();
a.on('message', () => {})
a.emit('message');

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published