Search.tsx 626 Bytes
Newer Older
David Haynes's avatar
David Haynes committed
1
import { connect } from 'react-redux';
David Haynes's avatar
David Haynes committed
2
3
import { addCourseSection } from '../actions/schedule/schedule.actions';
import { searchCourseSections } from '../actions/search/search.actions';
David Haynes's avatar
David Haynes committed
4
import SearchRoot from '../components/SearchRoot';
Andrew Hrdy's avatar
Andrew Hrdy committed
5
6
import { State } from '../reducers';

7
8
// Takes the current Redux state and returns objects which will be
// passed to the component as Props
Andrew Hrdy's avatar
Andrew Hrdy committed
9
const mapStateToProps = (state: State) => ({
10
    search: state.search,
Andrew Hrdy's avatar
Andrew Hrdy committed
11
12
});

13
// Pass mapStateToProps and other values to the component's props
David Haynes's avatar
David Haynes committed
14
15
export default connect(
    mapStateToProps,
David Haynes's avatar
David Haynes committed
16
    { searchCourseSections, addCourseSection }
David Haynes's avatar
David Haynes committed
17
)(SearchRoot);