Skip to content

Instantly share code, notes, and snippets.

@gaurav5430
Created September 27, 2018 06:58
Show Gist options
  • Save gaurav5430/a906ae921c484edc5ebb5b5a4872c3a5 to your computer and use it in GitHub Desktop.
Save gaurav5430/a906ae921c484edc5ebb5b5a4872c3a5 to your computer and use it in GitHub Desktop.
export const asyncApiCall = (values) => {
return async dispatch => {
try {
const response = await axios.get(url);
dispatch(successHandle(response));
}
catch(error) {
dispatch(errorHandle(error));
}
return 'done';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment