{"size": 597, "ext": "js", "max_stars_repo_path": "src/store/reducers.js", "max_stars_repo_name": "l33th/blockchain-webapp", "max_stars_repo_stars_event_min_datetime": "2021-12-27T15:52:45.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-28T14:55:11.000Z", "max_issues_repo_path": "src/store/reducers.js", "max_issues_repo_name": "l33th/blockchain-webapp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/store/reducers.js", "max_forks_repo_name": "l33th/blockchain-webapp", "max_forks_repo_forks_event_min_datetime": "2022-01-14T10:21:25.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-14T10:21:25.000Z"}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 22.1111111111, "max_line_length": 57, "alphanum_fraction": 0.6800670017}
import { combineReducers } from 'redux';

import {
  WEB3_CONNECTION_LOADED,
  WEB3_ACCOUNTS_LOADED,
  WEB3_NETWORK_LOADED,
} from './actions';

function web3(state = { accounts: {} }, action) {
  switch (action.type) {
    case WEB3_CONNECTION_LOADED:
      return { ...state, connection: action.connection };
    case WEB3_ACCOUNTS_LOADED:
      return { ...state, accounts: action.accounts };
    case WEB3_NETWORK_LOADED:
      return { ...state, network: action.network };
    default:
      return state;
  }
}

const rootReducer = combineReducers({
  web3,
});

export default rootReducer;
