src/emitter.js
function getListeners(eventName, handler, context, args) {
    if (!this.__listeners || !this.__listeners[eventName]) {
        return null;
    }

    return this.__listeners[eventName]
        .map((config) => {
            if (handler !== undefined && config.fn !== handler) {
                return false;
            }
            if (context !== undefined && config.context !== context) {
                return false;
            }
            if (args !== undefined && config.args !== args) {
                return false;
            }
            return config;
        })
        .filter((result) => !!result);
}
function getListeners(eventName, handler, context, args) {
    if (!this.__listeners || !this.__listeners[eventName]) {
        return null;
    }

    return this.__listeners[eventName]
        .map((config) => {
            if (handler !== undefined && config.fn !== handler) {
                return false;
            }
            if (context !== undefined && config.context !== context) {
                return false;
            }
            if (args !== undefined && config.args !== args) {
                return false;
            }
            return config;
        })
        .filter((result) => !!result);
}
function getListeners ( eventName , handler , context , args ) { if ( ! this . __listeners || ! this . __listeners [ eventName ] ) { return null ; } return this . __listeners [ eventName ] . map ( ( config ) => { if ( handler !== undefined && config . fn !== handler ) { return false ; } if ( context !== undefined && config . context !== context ) { return false ; } if ( args !== undefined && config . args !== args ) { return false ; } return config ; } ) . filter ( ( result ) => ! ! result ) ; }
Gets all listeners that match criteria
@param   {string} eventName required
@param   {function} handler   if defined will be used for match
@param   {object} context   if defined will be used for match
@param   {array} args      if defined will be used for match
@returns {array<EventConfig>|null}
Gets all listeners that match criteria