mediawiki-extensions-Popups/resources/ext.popups/boot.js
Sam Smith 83dbf746ba Enable Redux DevTools in debug mode
Also, fix a bug introduced in Ib7168217 wherein the non-existent
Redux.thunk was referenced rather than ReduxThunk.default.

Change-Id: Ia4cc28b16b17442de69ed84bb8e8c88a6a9f201d
2016-11-09 10:38:20 +00:00

32 lines
772 B
JavaScript

( function ( mw, Redux, ReduxThunk ) {
/**
* A [null](https://en.wikipedia.org/wiki/Null_Object_pattern) reducer.
*
* @param {Object} state The current state
* @param {Object} action The action that was dispatched against the store
* @return {Object} The new state
*/
function rootReducer( state, action ) {
/* jshint unused: false */
return state;
}
mw.requestIdleCallback( function () {
var compose = Redux.compose;
// If debug mode is enabled, then enable Redux DevTools.
if ( mw.config.get( 'debug' ) === true ) {
compose = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
}
Redux.createStore(
rootReducer,
compose( Redux.applyMiddleware(
ReduxThunk.default
) )
);
} );
}( mediaWiki, Redux, ReduxThunk ) );