Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@maximgatilin
Created August 8, 2018 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximgatilin/7fcab843035e05e7625fa31807f564ce to your computer and use it in GitHub Desktop.
Save maximgatilin/7fcab843035e05e7625fa31807f564ce to your computer and use it in GitHub Desktop.
Bad reducer
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