{"size": 472, "ext": "js", "max_stars_repo_path": "web-client/src/presenter/actions/clearViewerDocumentToDisplayAction.js", "max_stars_repo_name": "codyseibert/ef-cms", "max_stars_repo_stars_event_min_datetime": "2018-09-16T17:05:55.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-28T15:30:54.000Z", "max_issues_repo_path": "web-client/src/presenter/actions/clearViewerDocumentToDisplayAction.js", "max_issues_repo_name": "codyseibert/ef-cms", "max_issues_repo_issues_event_min_datetime": "2018-10-10T18:39:26.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T16:30:12.000Z", "max_forks_repo_path": "web-client/src/presenter/actions/clearViewerDocumentToDisplayAction.js", "max_forks_repo_name": "codyseibert/ef-cms", "max_forks_repo_forks_event_min_datetime": "2018-10-09T21:02:23.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-22T10:09:37.000Z"}
{"max_stars_count": 52, "max_issues_count": 2108, "max_forks_count": 23, "avg_line_length": 29.5, "max_line_length": 73, "alphanum_fraction": 0.718220339}
import { state } from 'cerebral';

/**
 * clears the viewerDocumentToDisplay from state
 *
 * @param {object} providers the providers object
 * @param {object} providers.props the cerebral props object
 * @param {object} providers.store the cerebral store object
 */
export const clearViewerDocumentToDisplayAction = ({ props, store }) => {
  if (props.tabName === 'documentView') {
    store.unset(state.viewerDocumentToDisplay);
    store.unset(state.iframeSrc);
  }
};
