Guest User

Untitled

a guest
Apr 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. const initialState = {
  2. previousLocation: null,
  3. currentLocation: null,
  4. };
  5. const routerLocations = function (state = initialState, action) {
  6. const newstate = { ...state };
  7. switch (action.type) {
  8. case "@@router/LOCATION_CHANGE":
  9. newState.previousLocation = state.currentLocation;
  10. newState.currentLocation = action.payload;
  11. return newState
  12. default:
  13. return state;
  14. }
  15. }
  16.  
  17. export default routerLocations;
  18.  
  19. "react-router": "^4.2.0",
  20. "react-router-dom": "^4.2.2",
  21. "react-router-redux": "^4.0.8",
Add Comment
Please, Sign In to add comment