text: import {ANSWER_QUESTION, RECEIVE_QUESTIONS, SAVE_QUESTION} from "../actions/questions";
  
  export default function questions(state = {}, action) {
      switch (action.type) {
          case RECEIVE_QUESTIONS:
              return {
                  ...state,
                  ...action.questions
              }
          case SAVE_QUESTION:
              return {
                  ...state,
                  [action.question.id]: action.question
              }
          case ANSWER_QUESTION:
              return {
                  ...state,
                  [action.id]: {
                      ...state[action.id],
                      [action.answer]: {
                          ...state[action.id][action.answer],
                          votes: state[action.id][action.answer].votes.concat([action.authedUser])
                      }
                  },
              }
          default:
              return state;
      }
  }