2017.08.27
New
const Object.deepFreeze = function(obj) {
var propNames = Object.getOwnPropertyNames(obj);
propNames.forEach((name) => {
if (typeof obj[name] == 'object' && obj[name] !== null) {
Object.deepFreeze(obj[name]);
}
});
return Object.freeze(obj);
}
const logger = store => next => action => {
console.log('dispatching', action)
let result = next(action)
console.log('next state', store.getState())
return result
};
const logger = function(store) {
return function(next) {
return function(action) {
console.log('dispatch', action);
let result = next(action);
console.log('next state', store.getState())
}
}
}