1.0.0 • Published 4 years ago

small-events-manager v1.0.0

Weekly downloads
1
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

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);