mediawiki-extensions-Popups/resources/ext.popups/boot.js
Sam Smith e47fe4d04d Use Redux and Redux Thunk
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
2016-11-08 15:33:20 -05:00

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 ) );