Skip to content

Instantly share code, notes, and snippets.

@mvbattan
Last active December 19, 2017 23:59
Show Gist options
  • Save mvbattan/a7bcc3dcd5d8239df862e8b772297cd7 to your computer and use it in GitHub Desktop.
Save mvbattan/a7bcc3dcd5d8239df862e8b772297cd7 to your computer and use it in GitHub Desktop.
Compose Injections
const actionCreators = {
fetchSomething: () => composeInjections(
baseThunkAction(actions.FETCH, 'fetchTarget', Service.fetch),
withPostSuccess(dispatch => dispatch(navigationActions.push('/successRoute'))),
withStatusHandling({ 404: dispatch => dispatch(navigationActions.push('/failureRoute')) })
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment