Created
April 20, 2018 15:23
-
-
Save sammdec/1a933ee0724b12a0aad00d2a5c3d126e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const handleSelectUpdate = (target) => { | |
return { [target.name]: target.value }; | |
}; | |
handleChosenCountry: (state, target) => | |
const selectState = handleSelectUpdate(target); | |
const newState = handleChosenCountry(state, target.value) | |
handleFetchEvents({ ...state, chosenCountry: selectState.country }).then(res => { | |
store.setState({ | |
...state, | |
...newState, | |
events: res.data, | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment