evn
Manage events in JavaScript
Installation
npm install --save evn
API
evn.add(id, callback, scope)
Add a new event listener.
id
A string
withe the event ID.
callback
The function that will be executed when the event is executed.
scope
The value of this
where the callback
will be executed.
evn.send(id[, args])
Emit an event.
id
The event ID that will be executed.
args (optionally)
Arguments for the callback.
Example
//Import dependenciesvar evn = ; //Add a new eventevn; //Call the eventevn; // -> Hello Susan!!