{"size": 624, "ext": "js", "max_stars_repo_path": "src/containers/admin/containers/home/store/reducers/addresses.js", "max_stars_repo_name": "er5bus/sm", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/containers/admin/containers/home/store/reducers/addresses.js", "max_issues_repo_name": "er5bus/sm", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/containers/admin/containers/home/store/reducers/addresses.js", "max_forks_repo_name": "er5bus/sm", "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": 21.5172413793, "max_line_length": 77, "alphanum_fraction": 0.6201923077}
import { ACTIONS } from "./../constants"


const initialState = {
  addresses: [], 
  isFetching: false,
  error: null
}


export default (state = initialState , action) => {
  const { payload, type } = action
  switch (type) {
    case ACTIONS.FETCH_STRUCTURES_INIT : {
      return { ...state, isFetching: true, error: null }
    }
    case ACTIONS.FETCH_STRUCTURES_SUCCEDED : {
      return { ...state, addresses: payload, isFetching: false, error: null }
    }
    case ACTIONS.FETCH_STRUCTURES_FAILED : {
      return { ...state, isFetching: false, error: payload }
    }

    default: {
      return state
    }
  }
}
