{"size": 414, "ext": "js", "max_stars_repo_path": "src/store/reducers/searchStockReducer.js", "max_stars_repo_name": "Mandy0603/F-Info", "max_stars_repo_stars_event_min_datetime": "2019-07-04T03:25:22.000Z", "max_stars_repo_stars_event_max_datetime": "2019-07-04T03:25:22.000Z", "max_issues_repo_path": "src/store/reducers/searchStockReducer.js", "max_issues_repo_name": "Mandy0603/F-Info", "max_issues_repo_issues_event_min_datetime": "2020-07-17T17:24:22.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-22T08:04:53.000Z", "max_forks_repo_path": "src/store/reducers/searchStockReducer.js", "max_forks_repo_name": "Mandy0603/F-Info", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 20.7, "max_line_length": 75, "alphanum_fraction": 0.6497584541}
import { SEARCH_STOCK, CLEAR_SEARCH_RESULT } from "../actions/actionTypes";

const initialState = {
  stockList: []
};

const reducer = (state = initialState, action) => {
  switch (action.type) {
    case SEARCH_STOCK:
      return { ...state, stockList: action.payload };
    case CLEAR_SEARCH_RESULT:
      return { ...state, ...initialState };

    default:
      return state;
  }
};

export default reducer;
