lib/factories/service.factory.js
function emitEvent(payload, eventNameBase, debugParams) {

        // create a copy of the payload so that nothing modifies the original object
        try {
            payload = JSON.parse(JSON.stringify(payload));
        }
        catch (err) {
            /* eslint no-console:0 */
            console.log('issue parsing during emit ' + JSON.stringify(eventNameBase));
        }

        // we don't want to emit the potentially huge resource file
        if (payload && payload.resource) {
            delete payload.resource;
        }

        // create the event data and emit the event
        var name = _.extend({}, eventNameBase, debugParams);
        var eventData = {
            name: name,
            payload: payload
        };
        var eventName = name.resource + '.' + name.adapter + '.' + name.method;
        eventName += debugParams ? '.' + name.type + '.' + name.timing : '';
        eventBus.emit(eventName, eventData);
    }
function emitEvent(payload, eventNameBase, debugParams) {

        // create a copy of the payload so that nothing modifies the original object
        try {
            payload = JSON.parse(JSON.stringify(payload));
        }
        catch (err) {
            /* eslint no-console:0 */
            console.log('issue parsing during emit ' + JSON.stringify(eventNameBase));
        }

        // we don't want to emit the potentially huge resource file
        if (payload && payload.resource) {
            delete payload.resource;
        }

        // create the event data and emit the event
        var name = _.extend({}, eventNameBase, debugParams);
        var eventData = {
            name: name,
            payload: payload
        };
        var eventName = name.resource + '.' + name.adapter + '.' + name.method;
        eventName += debugParams ? '.' + name.type + '.' + name.timing : '';
        eventBus.emit(eventName, eventData);
    }
function emitEvent ( payload , eventNameBase , debugParams ) { // create a copy of the payload so that nothing modifies the original object try { payload = JSON . parse ( JSON . stringify ( payload ) ) ; } catch ( err ) { /* eslint no-console:0 */ console . log ( 'issue parsing during emit ' + JSON . stringify ( eventNameBase ) ) ; } // we don't want to emit the potentially huge resource file if ( payload && payload . resource ) { delete payload . resource ; } // create the event data and emit the event var name = _ . extend ( { } , eventNameBase , debugParams ) ; var eventData = { name : name , payload : payload } ; var eventName = name . resource + '.' + name . adapter + '.' + name . method ; eventName += debugParams ? '.' + name . type + '.' + name . timing : '' ; eventBus . emit ( eventName , eventData ) ; }
This is used to get an mock filter which will be sending out events
@param payload
@param eventNameBase
@param debugParams
This is used to get an mock filter which will be sending out events