import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { Timeslider } from './timeslider' ; import { closeTimeslider , setQuery } from '../../actions' ; import { getTimeFilters } from '../../selectors/map_selectors' ; import { getIsTimesliderOpen } from '../../selectors/ui_selectors' ; import { MapStoreState } from '../../reducers/store' ; import { Timeslice } from '../../../common/descriptor_types' ; function mapStateToProps ( state ) { return { isTimesliderOpen : getIsTimesliderOpen ( state ) , timeRange : getTimeFilters ( state ) , } ; } function mapDispatchToProps ( dispatch ) { return { closeTimeslider : ( ) => { dispatch ( closeTimeslider ( ) ) ; } , setTimeslice : ( timeslice ) => { dispatch ( setQuery ( { forceRefresh : false , timeslice , } ) ) ; } , } ; } const connected = connect ( mapStateToProps , mapDispatchToProps ) ( Timeslider ) ; export { connected as Timeslider } ;