src/events.js
function addListener(event, callback) {
    checkEventValid(event);

    if (listeners[event]) {
        listeners[event].push(callback);
    } else {
        listeners[event] = [callback];
    }
}
function addListener(event, callback) {
    checkEventValid(event);

    if (listeners[event]) {
        listeners[event].push(callback);
    } else {
        listeners[event] = [callback];
    }
}
function addListener ( event , callback ) { checkEventValid ( event ) ; if ( listeners [ event ] ) { listeners [ event ] . push ( callback ) ; } else { listeners [ event ] = [ callback ] ; } }
Add a new event listener
@param {events} event - The name of the event listener to add an event for
@param {function} callback - The callback to invoke when the event is called
Add a new event listener