import { LOCATION_CHANGE } from 'react-router-redux';

export function patchObjectByKey(object, key, patcher) {
  return key in object ? { ...object, [key]: patcher(object[key]) } : object;
}

export function setOnLocationChange(targetState) {
  return (state, action) => {
    if (action.type === LOCATION_CHANGE) {
      return targetState;
    }
    return state;
  };
}

@@ -233,16 +233,39 @@
 getState
+, excludePathnames = %5B%5D
 ) %7B%0A  re
@@ -329,16 +329,71 @@
 N_CHANGE
+ && !excludePathnames.includes(action.payload.pathname)
 ) %7B%0A    

Add an excludePathnames parameter to the setOnLocationChange helper