Initial commit
This commit is contained in:
29
node_modules/react-router-redux/middleware.js
generated
vendored
Normal file
29
node_modules/react-router-redux/middleware.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = routerMiddleware;
|
||||
|
||||
var _actions = require('./actions');
|
||||
|
||||
/**
|
||||
* This middleware captures CALL_HISTORY_METHOD actions to redirect to the
|
||||
* provided history object. This will prevent these actions from reaching your
|
||||
* reducer or any middleware that comes after this one.
|
||||
*/
|
||||
function routerMiddleware(history) {
|
||||
return function () {
|
||||
return function (next) {
|
||||
return function (action) {
|
||||
if (action.type !== _actions.CALL_HISTORY_METHOD) {
|
||||
return next(action);
|
||||
}
|
||||
|
||||
var _action$payload = action.payload,
|
||||
method = _action$payload.method,
|
||||
args = _action$payload.args;
|
||||
|
||||
history[method].apply(history, args);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user