Merge "Hygiene: Remove unnecessary IIFE in changeListeners/eventLogging.js"

This commit is contained in:
jenkins-bot 2017-02-20 17:23:35 +00:00 committed by Gerrit Code Review
commit 319c04ce2f
3 changed files with 22 additions and 24 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1,28 +1,26 @@
( function ( $ ) { var $ = jQuery;
/** /**
* Creates an instance of the event logging change listener. * Creates an instance of the event logging change listener.
* *
* When an event is enqueued to be logged it'll be logged using the schema. * When an event is enqueued to be logged it'll be logged using the schema.
* Since it's the responsibility of EventLogging (and the UA) to deliver * Since it's the responsibility of EventLogging (and the UA) to deliver
* logged events, the `EVENT_LOGGED` is immediately dispatched rather than * logged events, the `EVENT_LOGGED` is immediately dispatched rather than
* waiting for some indicator of completion. * waiting for some indicator of completion.
* *
* @param {Object} boundActions * @param {Object} boundActions
* @param {mw.eventLog.Schema} schema * @param {mw.eventLog.Schema} schema
* @return {ext.popups.ChangeListener} * @return {ext.popups.ChangeListener}
*/ */
module.exports = function ( boundActions, schema ) { module.exports = function ( boundActions, schema ) {
return function ( _, state ) { return function ( _, state ) {
var eventLogging = state.eventLogging, var eventLogging = state.eventLogging,
event = eventLogging.event; event = eventLogging.event;
if ( event ) { if ( event ) {
schema.log( $.extend( true, {}, eventLogging.baseData, event ) ); schema.log( $.extend( true, {}, eventLogging.baseData, event ) );
boundActions.eventLogged(); boundActions.eventLogged();
} }
};
}; };
};
}( jQuery ) );