index.js
function on(event, fn) {
		if (typeof event !== 'string') {
			throw new Error('"event" not a string');
		}
		if (!(fn instanceof Function)) {
			throw new Error('"fn" not a Function');
		}

		if (hasListener(event, fn)) {
			return false;
		}

		if (!hasListeners(event)) {
			listeners[event] = [];
		}
		listeners[event].push(fn);

		return true;
	}
function on(event, fn) {
		if (typeof event !== 'string') {
			throw new Error('"event" not a string');
		}
		if (!(fn instanceof Function)) {
			throw new Error('"fn" not a Function');
		}

		if (hasListener(event, fn)) {
			return false;
		}

		if (!hasListeners(event)) {
			listeners[event] = [];
		}
		listeners[event].push(fn);

		return true;
	}
function on ( event , fn ) { if ( typeof event !== 'string' ) { throw new Error ( '"event" not a string' ) ; } if ( ! ( fn instanceof Function ) ) { throw new Error ( '"fn" not a Function' ) ; } if ( hasListener ( event , fn ) ) { return false ; } if ( ! hasListeners ( event ) ) { listeners [ event ] = [ ] ; } listeners [ event ] . push ( fn ) ; return true ; }
Registers a listener for a type of event.
@param {string} event the event type
@param {Function} fn the function to invoke to handle the event
@return {boolean} true if listener set was modified, false if not
Registers a listener for a type of event .