Skip to content

Instantly share code, notes, and snippets.

@olegkalyta
Created October 21, 2016 07:49
Show Gist options
  • Save olegkalyta/c1fe87b6d023fa49115bbbf914ca0163 to your computer and use it in GitHub Desktop.
Save olegkalyta/c1fe87b6d023fa49115bbbf914ca0163 to your computer and use it in GitHub Desktop.
Ask Dan
function patchStoreToAddLogging(store) {
let next = store.dispatch
store.dispatch = function dispatchAndLog(action) {
console.log('dispatching', action)
let result = next(action)
console.log('next state', store.getState())
return result
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment