{"size": 405, "ext": "js", "max_stars_repo_path": "src/reducers/hierarchyReducer.js", "max_stars_repo_name": "alfredo-pozo/DynamoDictionary", "max_stars_repo_stars_event_min_datetime": "2016-10-17T18:35:52.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-23T05:27:55.000Z", "max_issues_repo_path": "src/reducers/hierarchyReducer.js", "max_issues_repo_name": "alfredo-pozo/DynamoDictionary", "max_issues_repo_issues_event_min_datetime": "2016-08-18T17:29:40.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-10T21:59:26.000Z", "max_forks_repo_path": "src/reducers/hierarchyReducer.js", "max_forks_repo_name": "alfredo-pozo/DynamoDictionary", "max_forks_repo_forks_event_min_datetime": "2016-05-12T15:48:29.000Z", "max_forks_repo_forks_event_max_datetime": "2021-07-01T22:20:41.000Z"}
{"max_stars_count": 11, "max_issues_count": 61, "max_forks_count": 22, "avg_line_length": 21.3157894737, "max_line_length": 63, "alphanum_fraction": 0.6543209877}
import { UPDATE_HIERARCHY } from "../actions/hierarchyActions";

const initialState = {
  hierarchy: [],
  searchArray: []
};

const hierarchy = (state = initialState, action) => {
  switch (action.type) {
    case UPDATE_HIERARCHY:
      const { hierarchy, searchArray } = action.data;
      return { ...state, hierarchy, searchArray };
    default:
      return state;
  }
};

export default hierarchy;
