mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-11 07:16:08 +00:00
83dbf746ba
Also, fix a bug introduced in Ib7168217 wherein the non-existent Redux.thunk was referenced rather than ReduxThunk.default. Change-Id: Ia4cc28b16b17442de69ed84bb8e8c88a6a9f201d
32 lines
772 B
JavaScript
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 ) );
|