1.0.0 • Published 4 years ago
small-events-manager v1.0.0
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);
1.0.0
4 years ago