{"size": 1714, "ext": "js", "max_stars_repo_path": "app/containers/Admin/ReportShiftFrequency/index.js", "max_stars_repo_name": "RobertSomodi/RAU", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/containers/Admin/ReportShiftFrequency/index.js", "max_issues_repo_name": "RobertSomodi/RAU", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/containers/Admin/ReportShiftFrequency/index.js", "max_forks_repo_name": "RobertSomodi/RAU", "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": 27.6451612903, "max_line_length": 75, "alphanum_fraction": 0.7432905484}
import { connect } from 'react-redux'
import { compose } from 'redux'
import { createStructuredSelector } from 'reselect'
import injectReducer from 'utils/injectReducer'
import injectSaga from 'utils/injectSaga'
import { makeSelectLoading } from 'containers/App/selectors'
import { makeSelectInfo } from 'containers/Admin/selectors'
import {
  onSearchOptionsChange,
  getDepartmentsByStoreId,
  getReportShiftFrequency,
} from './actions'
import reducer from './reducer'
import saga from './saga'
import ReportShiftFrequency from './ReportShiftFrequency'
import {
  makeSelectSearchOptions,
  makeSelectDepartments,
  makeSelectReportShiftFrequency,
} from './selectors'

const mapStateToProps = createStructuredSelector({
  loading: makeSelectLoading(),
  info: makeSelectInfo(),
  searchOptions: makeSelectSearchOptions(),
  departments: makeSelectDepartments(),
  reportShiftFrequency: makeSelectReportShiftFrequency(),
})

const mapDispatchToProps = dispatch => ({
  onSearchOptionsChange: searchOptions => {
    dispatch(onSearchOptionsChange(searchOptions))
  },
  getDepartmentsByStoreId: id =>
    new Promise((resolve, reject) => {
      dispatch(getDepartmentsByStoreId(id))
      resolve()
    }),
  onSearch: () =>
    new Promise((resolve, reject) => {
      dispatch(getReportShiftFrequency())
      setTimeout(() => {
        resolve()
      }, 2000)
    }),
})

const withConnect = connect(
  mapStateToProps,
  mapDispatchToProps
)

const withReducer = injectReducer({ key: 'reportShiftFrequency', reducer })
const withSaga = injectSaga({ key: 'reportShiftFrequency', saga })

export default compose(
  withReducer,
  withSaga,
  withConnect
)(ReportShiftFrequency)
export { mapDispatchToProps }
