Skip to content

Instantly share code, notes, and snippets.

@apisandipas
Last active July 2, 2019 15:54
Show Gist options
  • Save apisandipas/f5d094193bd212678606e4b94010de55 to your computer and use it in GitHub Desktop.
Save apisandipas/f5d094193bd212678606e4b94010de55 to your computer and use it in GitHub Desktop.
const fetchArticles = () => async (dispatch, getState, { api }) => {
//… request action fired..
try {
await api.get(‘/relative-path’) // already pointed to API server
// dispatch success
} catch(e) {
//dispatch error
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment