2016-11-08 11:06:19 +00:00
|
|
|
( function ( mw, Redux, ReduxThunk ) {
|
2016-11-08 10:05:40 +00:00
|
|
|
|
|
|
|
/**
|
2016-11-08 11:06:19 +00:00
|
|
|
* A [null](https://en.wikipedia.org/wiki/Null_Object_pattern) reducer.
|
2016-11-08 10:05:40 +00:00
|
|
|
*
|
2016-11-08 11:06:19 +00:00
|
|
|
* @param {Object} state The current state
|
|
|
|
* @param {Object} action The action that was dispatched against the store
|
|
|
|
* @return {Object} The new state
|
2016-11-08 10:05:40 +00:00
|
|
|
*/
|
|
|
|
function rootReducer( state, action ) {
|
|
|
|
/* jshint unused: false */
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
|
|
|
mw.requestIdleCallback( function () {
|
2016-11-08 11:06:19 +00:00
|
|
|
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(
|
2016-11-08 10:05:40 +00:00
|
|
|
rootReducer,
|
2016-11-08 11:06:19 +00:00
|
|
|
compose( Redux.applyMiddleware(
|
|
|
|
ReduxThunk.default
|
|
|
|
) )
|
2016-11-08 10:05:40 +00:00
|
|
|
);
|
|
|
|
} );
|
|
|
|
|
2016-11-08 11:06:19 +00:00
|
|
|
}( mediaWiki, Redux, ReduxThunk ) );
|