import { AnyAction } from 'redux' ; import { ThunkDispatch } from 'redux-thunk' ; import { connect } from 'react-redux' ; import type { Query } from 'src/plugins/data/public' ; import { FilterEditor } from './filter_editor' ; import { getSelectedLayer } from '../../../selectors/map_selectors' ; import { setLayerQuery , updateSourceProp } from '../../../actions' ; import { MapStoreState } from '../../../reducers/store' ; function mapStateToProps ( state ) { return { layer : getSelectedLayer ( state ) ! , } ; } function mapDispatchToProps ( dispatch ) { return { setLayerQuery : ( layerId , query ) => { dispatch ( setLayerQuery ( layerId , query ) ) ; } , updateSourceProp : ( id , propName , value ) => dispatch ( updateSourceProp ( id , propName , value ) ) , } ; } const connectedFilterEditor = connect ( mapStateToProps , mapDispatchToProps ) ( FilterEditor ) ; export { connectedFilterEditor as FilterEditor } ;