Skip to content

Instantly share code, notes, and snippets.

@naomiajacobs
Created October 31, 2016 21:35
Show Gist options
  • Save naomiajacobs/3f288c1a5f5ac61b0f978facb851c2df to your computer and use it in GitHub Desktop.
Save naomiajacobs/3f288c1a5f5ac61b0f978facb851c2df to your computer and use it in GitHub Desktop.
LoggerMiddleware
const logger = store => next => action => {
console.log('Action: ', action);
console.log('Next state: ', store.getState());
return next(action);
};
// const logger = function(store) {
// return function(next) {
// return function(action) {
// console.log('Action: ', action);
// console.log('Next state: ', store.getState());
// return next(action);
// };
// };
// };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment