Created
September 9, 2018 16:38
-
-
Save blabadi/3d2a707e066aadffa4ad6f2f0be53a35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const SEARCH_FOOD = 'SEARCH_FOOD'; | |
export function searchFood(term) { | |
console.log(`in searchFood ${term}`); | |
return { | |
type: SEARCH_FOOD, | |
term | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SearchBox from '../presentational/search/SearchBox'; | |
import {searchFood} from '../actions' | |
import {connect} from 'react-redux'; | |
const mapDispatchToProps = dispatch => ({ | |
onTermChange: term => dispatch(searchFood(term)) | |
}) | |
const mapStateToProps = (state) => { | |
return { | |
placeholderText: "Search for food", | |
title: "Add New Entry", | |
results: state.searchFoodResult | |
} | |
} | |
export default connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(SearchBox) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment