import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { LayerTOC } from './layer_toc' ; import { updateLayerOrder } from '../../../../actions' ; import { getLayerList } from '../../../../selectors/map_selectors' ; import { getIsReadOnly } from '../../../../selectors/ui_selectors' ; import { MapStoreState } from '../../../../reducers/store' ; function mapStateToProps ( state ) { return { isReadOnly : getIsReadOnly ( state ) , layerList : getLayerList ( state ) , } ; } function mapDispatchToProps ( dispatch ) { return { updateLayerOrder : ( newOrder ) => dispatch ( updateLayerOrder ( newOrder ) ) , } ; } const connected = connect ( mapStateToProps , mapDispatchToProps ) ( LayerTOC ) ; export { connected as LayerTOC } ;