Created
June 12, 2018 18:04
-
-
Save duhaime/9b3fac24bbcff702f46220685e58c54d to your computer and use it in GitHub Desktop.
axios.js
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 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