Created
August 10, 2017 13:34
-
-
Save treyhuffine/1b36b803b9cba67f58855a5196622ee5 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 = store => next => 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