Skip to content

Instantly share code, notes, and snippets.

@duhaime
Created June 12, 2018 18:04
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 duhaime/9b3fac24bbcff702f46220685e58c54d to your computer and use it in GitHub Desktop.
Save duhaime/9b3fac24bbcff702f46220685e58c54d to your computer and use it in GitHub Desktop.
axios.js
export const fetchTreeData = () => {
return dispatch => {
axios.get(config.endpoint + 'cats')
.then(res => dispatch(handleData(res.data)))
.catch(err => dispatch(requestFailed(err)))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment