Skip to content

Instantly share code, notes, and snippets.

@alieslamifard
Created February 28, 2019 13:38
Show Gist options
  • Save alieslamifard/2b6da55e3ff325a67fc1ba195e8fb06e to your computer and use it in GitHub Desktop.
Save alieslamifard/2b6da55e3ff325a67fc1ba195e8fb06e to your computer and use it in GitHub Desktop.
export function async someAction() {
const response = await someHelperFunctionThatCallAnotherService();
if (!response) {
return dispatch({
type: 'FAILURE'
})
}
return dispatch({
type: 'SUCCESS',
data: response
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment