Skip to content

Instantly share code, notes, and snippets.

@blabadi
Created September 9, 2018 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blabadi/3d2a707e066aadffa4ad6f2f0be53a35 to your computer and use it in GitHub Desktop.
Save blabadi/3d2a707e066aadffa4ad6f2f0be53a35 to your computer and use it in GitHub Desktop.
export const SEARCH_FOOD = 'SEARCH_FOOD';
export function searchFood(term) {
console.log(`in searchFood ${term}`);
return {
type: SEARCH_FOOD,
term
}
}
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