lib/base/broadcast.js
function (topic, callback) {
        if (!func.isFunction(callback)) {
            throw new Error("callback must be a function");
        }
        var handle = {
            topic: topic,
            cb: callback,
            pos: null
        };
        var list = listeners[topic];
        if (!list) {
            list = (listeners[topic] = []);
        }
        list.push(handle);
        handle.pos = list.length - 1;
        return handle;
    }
function (topic, callback) {
        if (!func.isFunction(callback)) {
            throw new Error("callback must be a function");
        }
        var handle = {
            topic: topic,
            cb: callback,
            pos: null
        };
        var list = listeners[topic];
        if (!list) {
            list = (listeners[topic] = []);
        }
        list.push(handle);
        handle.pos = list.length - 1;
        return handle;
    }
function ( topic , callback ) { if ( ! func . isFunction ( callback ) ) { throw new Error ( "callback must be a function" ) ; } var handle = { topic : topic , cb : callback , pos : null } ; var list = listeners [ topic ] ; if ( ! list ) { list = ( listeners [ topic ] = [ ] ) ; } list . push ( handle ) ; handle . pos = list . length - 1 ; return handle ; }
Listen for the broadcast of certain events

@example
comb.listen("hello", function(arg1, arg2){
console.log(arg1);
console.log(arg2);
});

@param {String} topic the topic to listen for
@param {Function} callback the funciton to call when the topic is published

@returns a handle to pass to {@link comb.unListen}
Listen for the broadcast of certain events