Created
September 27, 2018 06:25
-
-
Save gaurav5430/c03e569d52e1203f3b26fba8e2174946 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
export const asyncApiCall = (values) => { | |
return dispatch => { | |
return axios.get(url) | |
.then(response =>{ | |
dispatch(successHandle(response)); | |
}) | |
.catch(error => { | |
dispatch(errorHandle(error)); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment