function errorMessage(state = null, action) {
  const { type, error } = action

  if (type === ActionTypes.RESET_ERROR_MESSAGE) {
    return null
  } else if (error) {
    return action.error
  }

  return state
}
function errorMessage(state = null, action) {
  const { type, error } = action

  if (type === ActionTypes.RESET_ERROR_MESSAGE) {
    return null
  } else if (error) {
    return action.error
  }

  return state
}
function errorMessage ( state = null , action ) { const { type , error } = action if ( type === ActionTypes . RESET_ERROR_MESSAGE ) { return null } else if ( error ) { return action . error } return state }
Updates error message to notify about the failed fetches.
Updates error message to notify about the failed fetches .