Skip to content

Instantly share code, notes, and snippets.

@smashercosmo
Created June 28, 2016 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smashercosmo/f5c14adc59a4c30a195384613af0bd53 to your computer and use it in GitHub Desktop.
Save smashercosmo/f5c14adc59a4c30a195384613af0bd53 to your computer and use it in GitHub Desktop.
const store = createStore(
reducer,
applyMiddleware(thunk.withExtraArgument({analytics, api}))
)
// later
function fetchUser(id) {
return (dispatch, getState, {analytics, api}) => {
api.fetchUser().then(user => {
analytics.track(...);
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment