{"size": 538, "ext": "js", "max_stars_repo_path": "src/modules/Trending/reducer.js", "max_stars_repo_name": "calebissharp/awesome-feed", "max_stars_repo_stars_event_min_datetime": "2017-10-17T23:13:31.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-25T00:20:04.000Z", "max_issues_repo_path": "src/modules/Trending/reducer.js", "max_issues_repo_name": "calebissharp/awesome-feed", "max_issues_repo_issues_event_min_datetime": "2017-09-30T16:06:18.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-12T12:56:54.000Z", "max_forks_repo_path": "src/modules/Trending/reducer.js", "max_forks_repo_name": "calebissharp/awesome-feed", "max_forks_repo_forks_event_min_datetime": "2017-10-03T13:49:13.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-03T14:58:02.000Z"}
{"max_stars_count": 62, "max_issues_count": 61, "max_forks_count": 15, "avg_line_length": 21.52, "max_line_length": 67, "alphanum_fraction": 0.6338289963}
import { handleActions } from 'redux-actions';
import { defineState } from 'redux-localstore';
import { SET_TRENDING_USERS, SET_TRENDING_REPOS } from './actions';

const defaultState = {
  users: [],
  repos: [],
};

const initialState = defineState(defaultState)(`Trending`);

export default handleActions(
  {
    [SET_TRENDING_USERS]: (state, action) => ({
      ...state,
      users: action.payload,
    }),
    [SET_TRENDING_REPOS]: (state, action) => ({
      ...state,
      repos: action.payload,
    }),
  },
  initialState,
);
