const idea = (state = [], action) => {
  switch (action.type) {
    case "SET_IDEAS":
      return action.ideas
    case "ADD_IDEA":
      return [...state, action.idea]
    case "UPDATE_IDEA" :
      return state.map(idea => {
        return (idea.id === action.ideaId) ? Object.assign({}, idea, action.newAttributes) : idea
      })
    case "DELETE_IDEA" :
      return state.filter(idea => {
        return idea.id !== action.ideaId
      })
    default:
      return state
  }
}

export default idea

const idea = (state = [], action) => {
  switch (action.type) {
    case "SET_IDEAS":
      return action.ideas
    case "ADD_IDEA":
      return [...state, action.idea]
    case "UPDATE_IDEA" :
      return state.map(idea => {
        return (idea.id === action.ideaId) ? Object.assign({}, idea, action.newAttributes) : idea
      })
    case "DELETE_IDEA" :
      return state.filter(idea => idea.id !== action.ideaId)
    default:
      return state
  }
}

export default idea

Refactor to avoid using curly-brace-multi-line filter
Refactor to avoid using curly-brace-multi-line filter
