🔨 Lightweight and simple interpretation of popular event management / aggregation
I was created a blog post (in polish) about motivation why I created this tool:
https://piecioshka.pl/blog/2016/01/29/narzedzia-swiata-super-event-emitter.html
(I'm sorry, but I don't have time to translate this article into English)
npm install super-event-emitter
const { SuperEventEmitter } = require('super-event-emitter');
const bar = {};
SuperEventEmitter.mixin(bar);
bar.on('test', function () {
console.log('triggered!');
});
bar.emit('test');
import { SuperEventEmitter } from "super-event-emitter";
class Person extends SuperEventEmitter {
say(message) {
this.emit('say', message);
}
}
const p1 = new Person();
p1.on('say', function (message) {
console.log(message); // 'I love cookie'
});
p1.say('I love cookie');
API Documentation is available in separated document.
The MIT License @ 2016-2024