Created
August 10, 2017 13:41
-
-
Save treyhuffine/d28aa062e350506194241f3bf3967ae5 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
/** | |
* Logs all actions and states after they are dispatched. | |
*/ | |
const logger = function(store) { | |
return function(next) { | |
return function(action) { | |
console.group(action.type) | |
console.info('dispatching', action) | |
let result = next(action) | |
console.log('next state', store.getState()) | |
console.groupEnd(action.type) | |
return result | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment