Last active
June 18, 2020 11:57
-
-
Save NetanelBasal/7528d7128d0c806308eca1d2d49d26c5 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
export function logger( reducer ) { | |
return function newReducer( state, action ) { | |
console.group(action.type); | |
const nextState = reducer(currentState, action); | |
console.log(`%c prev state`, `color: #9E9E9E; font-weight: bold`, state); | |
console.log(`%c action`, `color: #03A9F4; font-weight: bold`, action); | |
console.log(`%c next state`, `color: #4CAF50; font-weight: bold`, nextState); | |
console.groupEnd(); | |
return nextState; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment