import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import { StyleSettings } from './style_settings' ; import { getSelectedLayer } from '../../../selectors/map_selectors' ; import { updateLayerStyleForSelectedLayer } from '../../../actions' ; import { MapStoreState } from '../../../reducers/store' ; import { StyleDescriptor } from '../../../../common/descriptor_types' ; function mapStateToProps ( state ) { return { layer : getSelectedLayer ( state ) ! , } ; } function mapDispatchToProps ( dispatch ) { return { updateStyleDescriptor : ( styleDescriptor ) => { dispatch ( updateLayerStyleForSelectedLayer ( styleDescriptor ) ) ; } , } ; } const connectedStyleSettings = connect ( mapStateToProps , mapDispatchToProps ) ( StyleSettings ) ; export { connectedStyleSettings as StyleSettings } ;