small-events-manager
v1.0.0
Published
small events manager
Downloads
2
Readme
eventsManager
A little module to add events to your class
const events = require('small-events-manager');
declare the on
method of the event class as the on method of your class :
self.on = events.on;
use the on method to add function on events :
yourClass.on("yourEvent", (data)=>{
//your code here
});
and into your class, use the run method to run an event, with your data :
events.run("yourEvent", data);