{"size": 933, "ext": "js", "max_stars_repo_path": "client/src/reducers/example.js", "max_stars_repo_name": "jlcanela/facebook-friends", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/reducers/example.js", "max_issues_repo_name": "jlcanela/facebook-friends", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "client/src/reducers/example.js", "max_forks_repo_name": "jlcanela/facebook-friends", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 34.5555555556, "max_line_length": 92, "alphanum_fraction": 0.6548767417}
import * as types from '../actions/actionTypes'

export function exampleReducer (state = {
  isLoading: false,
  data: [],
  adminName: '',
  adminStatus: '',
  error: false}
, action = null) {
  switch (action.type) {
    case types.RECV_ERROR:
      return Object.assign({}, state, { isLoading: false, error: true })
    case types.RECV_DATA:
      return Object.assign({}, state, { isLoading: false, data: action.data, error: false })
    case types.REQ_DATA:
      return Object.assign({}, state, { isLoading: true, error: false })
    case types.ADMIN_UPDATING:
      return Object.assign({}, state, { adminName: action.name, adminStatus: 'UPDATING' })
    case types.ADMIN_UPDATED:
      return Object.assign({}, state, { adminName: action.name, adminStatus: '' })
    case types.ADMIN_UPDATE_ERROR:
      return Object.assign({}, state, { adminName: action.name, adminStatus: 'ERROR' })
    default:
      return state
  }
};
