Skip to content

Instantly share code, notes, and snippets.

@hanipcode
Created February 27, 2017 03:25
Show Gist options
  • Select an option

  • Save hanipcode/77b1b1bbd5c5cf3e9363a0a9584c421e to your computer and use it in GitHub Desktop.

Select an option

Save hanipcode/77b1b1bbd5c5cf3e9363a0a9584c421e to your computer and use it in GitHub Desktop.
redux real world example error reducer
const errorMessage = (state = null, action) => {
const { type, error } = action
if (type === ActionTypes.RESET_ERROR_MESSAGE) {
return null
} else if (error) {
return error
}
return state
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment