Created
June 28, 2016 16:54
-
-
Save smashercosmo/f5c14adc59a4c30a195384613af0bd53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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