Created
August 8, 2018 05:53
-
-
Save maximgatilin/7fcab843035e05e7625fa31807f564ce to your computer and use it in GitHub Desktop.
Bad reducer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case LOCATION_CHANGE: | |
if (action.payload.pathname === '/products') { | |
return { | |
...state, | |
productsPage: action.payload.query.page || state.productsPage | |
} | |
} else if (action.payload.pathname === '/users') { | |
return { | |
...state, | |
usersPage: action.payload.query.page || state.usersPage | |
} | |
} else return state; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment