function makeCounter() {
var currentCount = 1;
function counter(){
return currentCount++;
}
counter.set = function(value){
currentCount = value;
};
counter.reset = function(){
currentCount = 0;
};
return counter;
}
var counter = makeCounter();
console.log(counter());
var i = 0;
var devtools = function devtools(store) {
return function (next) {
return function (action) {
var result = next(action);
if (console.group) {
console.group('#' + i++, action.type, action);
_(store.getState()).map(function (val, key) {
console.log(key, val);
});
console.groupEnd();
}
return result;
};
};
};