/**
 * Created by myth on 3/10/16.
 */

var MicroEvent = function () {

    var debug = true;
    var self = this
    self.events = {}

    return {
        // Fire an event
        fire: function (event) {

            if (debug) console.log('Firing event: ' + event)

            // Attempt to fetch the event queue and fire event to all listeners
            var listeners = self.events[event]
            if (typeof listeners === 'undefined') return
            for (var i = 0; i < listeners.length; i++) listeners[i]()
        },

        // Register as an event listener
        on: function (event, callback) {

            if (debug) console.log('Registering callback on event: ' + event)

            if (typeof self.events[event] === 'undefined') {
                self.events[event] = []
            }
            self.events[event].push(callback)
        }
    }
}



@@ -33,16 +33,17 @@
 6.%0A */%0A%0A
+%0A
 var Micr
@@ -152,17 +152,29 @@
        /
-/
+**%0A         *
  Fire an
@@ -179,16 +179,120 @@
 an event
+ of type %22event%22 to all registered listeners for that type.%0A         * @param %7Bstring%7D event%0A         */
 %0A       
@@ -659,39 +659,208 @@
    /
-/ Register as an event listener
+**%0A         * Register a callback on a given event type, that will invoke the callback function once the event fires.%0A         * @param %7Bstring%7D%C2%A0event%0A         * @param %7Bfunction%7D callback%0A         */
 %0A   

Add JSDoc to microevent