cleanup middleware pre-ship (mostly lint) (#329)

Fixes #180

URL middleware unused, but retained in expectation that we will need it shortly.
Fixed a bit of lint, mostly by reformatting or commenting out currently unused code.
This commit is contained in:
Bruce Martin
2018-10-15 08:45:34 -07:00
committed by GitHub
parent bf0154ada6
commit c7e6f54450
+13 -9
View File
@@ -1,15 +1,21 @@
// jshint esversion: 6 // jshint esversion: 6
import uri from "urijs"; // import uri from "urijs";
/*
NOTE: file currently not used, but retained as we expect to reinstate features in this
area shortly.
*/
/* /*
https://medium.com/@jacobp100/you-arent-using-redux-middleware-enough-94ffe991e6 https://medium.com/@jacobp100/you-arent-using-redux-middleware-enough-94ffe991e6
storeInstance => functionToCallWithAnActionThatWillSendItToTheNextMiddleware => actionThatDispatchWasCalledWith => valueToUseAsTheReturnValueOfTheDispatchCall storeInstance
=> functionToCallWithAnActionThatWillSendItToTheNextMiddleware
=> actionThatDispatchWasCalledWith
=> valueToUseAsTheReturnValueOfTheDispatchCall
*/ */
const updateURLMiddleware = store => { const updateURLMiddleware = (/* store */) => next => action => {
return next => { // const oldState = store.getState();
return action => {
const oldState = store.getState();
const nextAction = next(action); const nextAction = next(action);
if (action.type === "url changed") { if (action.type === "url changed") {
@@ -17,7 +23,7 @@ const updateURLMiddleware = store => {
return nextAction; return nextAction;
} }
const state = store.getState(); // const state = store.getState();
/************************************************************************ /************************************************************************
************************************************************************* *************************************************************************
@@ -76,8 +82,6 @@ const updateURLMiddleware = store => {
// } // }
return nextAction; return nextAction;
};
};
}; };
export default updateURLMiddleware; export default updateURLMiddleware;