import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { MapStoreState } from '../../../reducers/store' ; import { fitToDataBounds } from '../../../actions' ; import { getMapSettings } from '../../../selectors/map_selectors' ; import { FitToData } from './fit_to_data' ; function mapStateToProps ( state ) { const mapSettings = getMapSettings ( state ) ; return { autoFitToDataBounds : mapSettings . autoFitToDataBounds , } ; } function mapDispatchToProps ( dispatch ) { return { fitToBounds : ( ) => { dispatch ( fitToDataBounds ( ) ) ; } , } ; } const connectedFitToData = connect ( mapStateToProps , mapDispatchToProps ) ( FitToData ) ; export { connectedFitToData as FitToData } ;