{"size": 489, "ext": "js", "max_stars_repo_path": "reducers/vaccinations.js", "max_stars_repo_name": "reactivators-studio-playground/CarteJaune", "max_stars_repo_stars_event_min_datetime": "2016-01-21T08:27:05.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-08T10:13:01.000Z", "max_issues_repo_path": "reducers/vaccinations.js", "max_issues_repo_name": "reactivators-studio-playground/CarteJaune", "max_issues_repo_issues_event_min_datetime": "2016-01-26T15:58:26.000Z", "max_issues_repo_issues_event_max_datetime": "2017-06-28T11:38:17.000Z", "max_forks_repo_path": "reducers/vaccinations.js", "max_forks_repo_name": "reactivators-studio-playground/CarteJaune", "max_forks_repo_forks_event_min_datetime": "2016-01-26T15:49:29.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-28T18:29:21.000Z"}
{"max_stars_count": 241, "max_issues_count": 8, "max_forks_count": 36, "avg_line_length": 23.2857142857, "max_line_length": 50, "alphanum_fraction": 0.6564417178}
import { OrderedMap, Map } from 'immutable';
import uuid from 'uuid';
import {
  ADD_VACCINATION,
  FETCH_VACCINATIONS_SUCCESS,
} from '../constants/actions';

export default (state = OrderedMap(), action) => {
  switch (action.type) {
    case ADD_VACCINATION:
      return state.set(uuid(), Map({
        id: action.vaccineId,
        date: action.vaccinationDate,
      }));
    case FETCH_VACCINATIONS_SUCCESS:
      return action.vaccinations;
    default:
      return state;
  }
};
