File size: 577 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { connect } from 'react-redux';
import { fetchSpots, fetchSpot } from '../../actions/spot_actions';
import Search from './search';
import { updateFilter } from '../../actions/filter_actions';


const msp = state => ({
    spots: Object.values(state.entities.spots),
    search: state.ui.search
})

const mdp = dispatch => {
    return ({
        fetchSpots: () => dispatch(fetchSpots()),
        fetchSpot: id => dispatch(fetchSpot(id)),
        updateFilter: (filter, value) => dispatch(updateFilter(filter, value))
    });
}


export default connect(msp, mdp)(Search);