{"size": 1139, "ext": "js", "max_stars_repo_path": "src/app-actions.js", "max_stars_repo_name": "flekschas/hipiler", "max_stars_repo_stars_event_min_datetime": "2017-06-23T18:04:42.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-05T07:33:21.000Z", "max_issues_repo_path": "src/app-actions.js", "max_issues_repo_name": "flekschas/hipiler", "max_issues_repo_issues_event_min_datetime": "2017-04-05T17:08:32.000Z", "max_issues_repo_issues_event_max_datetime": "2019-10-08T07:50:12.000Z", "max_forks_repo_path": "src/app-actions.js", "max_forks_repo_name": "flekschas/hipiler", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 12, "max_issues_count": 28, "max_forks_count": null, "avg_line_length": 24.2340425532, "max_line_length": 66, "alphanum_fraction": 0.7471466198}
import {
  updateConfig as updateHglConfig
} from 'components/higlass/higlass-actions';

import {
  setDataDims,
  setDataPadding,
  setDataPercentile,
  setDataIgnoreDiags,
  selectPile,
  updateConfig as updateFgmConfig
} from 'components/fragments/fragments-actions';

import FgmState from 'components/fragments/fragments-state';

export const UPDATE_CONFIG = 'UPDATE_CONFIG';

export const updateConfigs = config => (dispatch) => {
  // Reset entire fgm state
  FgmState.reset();

  dispatch(selectPile(null));
  dispatch(updateHglConfig(config.hgl));
  dispatch(updateFgmConfig(config.fgm));

  if (config.fgm.fragmentsDims) {
    dispatch(setDataDims(config.fgm.fragmentsDims));
  }
  if (config.fgm.fragmentsPadding) {
    dispatch(setDataPadding(config.fgm.fragmentsPadding));
  }
  if (config.fgm.fragmentsPercentile) {
    dispatch(setDataPercentile(config.fgm.fragmentsPercentile));
  }
  if (config.fgm.fragmentsIgnoreDiags) {
    dispatch(setDataIgnoreDiags(config.fgm.fragmentsIgnoreDiags));
  }
};


export const RESET_STATE = 'RESET_STATE';

export const resetState = () => ({
  type: RESET_STATE,
  payload: undefined
});
