src/eventsource.js
function ( eventName ) {
        var events = this.events[ eventName ];
        if ( !events || !events.length ) {
            return null;
        }
        events = events.length === 1 ?
            [ events[ 0 ] ] :
            Array.apply( null, events );
        return function ( source, args ) {
            var i,
                length = events.length;
            for ( i = 0; i < length; i++ ) {
                if ( events[ i ] ) {
                    args.eventSource = source;
                    args.userData = events[ i ].userData;
                    events[ i ].handler( args );
                }
            }
        };
    }
function ( eventName ) {
        var events = this.events[ eventName ];
        if ( !events || !events.length ) {
            return null;
        }
        events = events.length === 1 ?
            [ events[ 0 ] ] :
            Array.apply( null, events );
        return function ( source, args ) {
            var i,
                length = events.length;
            for ( i = 0; i < length; i++ ) {
                if ( events[ i ] ) {
                    args.eventSource = source;
                    args.userData = events[ i ].userData;
                    events[ i ].handler( args );
                }
            }
        };
    }
function ( eventName ) { var events = this . events [ eventName ] ; if ( ! events || ! events . length ) { return null ; } events = events . length === 1 ? [ events [ 0 ] ] : Array . apply ( null , events ) ; return function ( source , args ) { var i , length = events . length ; for ( i = 0 ; i < length ; i ++ ) { if ( events [ i ] ) { args . eventSource = source ; args . userData = events [ i ] . userData ; events [ i ] . handler ( args ) ; } } } ; }
Get a function which iterates the list of all handlers registered for a given event, calling the handler for each.
@function
@param {String} eventName - Name of event to get handlers for.
Get a function which iterates the list of all handlers registered for a given event calling the handler for each .