mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-03 19:56:39 +00:00
e47fe4d04d
Changes: * Create the ext.popups.lib module, which contains redux@3.6.0 and redux-thunk@2.1.0. * Rely on the Resource Loader's minification and mangling (?) mechanisms. * Create an asynchronous bootstrap script, which creates a Redux store when the User Agent is idle. Change-Id: Ib7168217a5673bb2a8378eb30d6aa45043c66e62
23 lines
446 B
JavaScript
23 lines
446 B
JavaScript
( function ( mw, rx ) {
|
|
|
|
/**
|
|
* Example reducer
|
|
*
|
|
* @param {Object} state global state before action
|
|
* @param {Object} action action that was performed
|
|
* @return {Object} global state after action
|
|
*/
|
|
function rootReducer( state, action ) {
|
|
/* jshint unused: false */
|
|
return state;
|
|
}
|
|
|
|
mw.requestIdleCallback( function () {
|
|
rx.createStore(
|
|
rootReducer,
|
|
rx.applyMiddleware( rx.thunk )
|
|
);
|
|
} );
|
|
|
|
}( mediaWiki, Redux ) );
|