{"size": 517, "ext": "js", "max_stars_repo_path": "src/views/containers/pages/search_results_page/search_results_data_fetch.js", "max_stars_repo_name": "michaelBenin/react-ssr-spa", "max_stars_repo_stars_event_min_datetime": "2016-04-24T00:25:25.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-30T18:14:59.000Z", "max_issues_repo_path": "src/views/containers/pages/search_results_page/search_results_data_fetch.js", "max_issues_repo_name": "michaelBenin/react-ssr-spa", "max_issues_repo_issues_event_min_datetime": "2016-11-02T19:33:48.000Z", "max_issues_repo_issues_event_max_datetime": "2018-09-17T17:56:16.000Z", "max_forks_repo_path": "src/views/containers/pages/search_results_page/search_results_data_fetch.js", "max_forks_repo_name": "michaelBenin/react-ssr-spa", "max_forks_repo_forks_event_min_datetime": "2017-10-11T20:29:52.000Z", "max_forks_repo_forks_event_max_datetime": "2019-04-25T08:04:12.000Z"}
{"max_stars_count": 33, "max_issues_count": 84, "max_forks_count": 5, "avg_line_length": 30.4117647059, "max_line_length": 95, "alphanum_fraction": 0.6943907157}
import { canUseDOM } from 'exenv';
import fetchSearchPageAction from '../../../../redux/actions/search/async_search_page_actions';
import log from '../../../../services/logger_service';

export default function fetchSearchData(nextState, dispatch, state) {
  if (canUseDOM) {
    if (state.config.initialPageLoad === true) {
      return false;
    }
  }
  return fetchSearchPageAction(nextState.params.query, dispatch, state).catch(
    function handleServerSideRenderError(err) {
      log.error(err);
    }
  );
}
