Tell us what’s happening:
Your code so far
const ADD = 'ADD';
const reducer = (state = 0, action) => {
switch(action.type) {
case ADD:
return state.count + 1;
default:
return state.count;
}
};
const store = Redux.createStore(reducer);
// global count variable:
let count = 0;
// change code below this line
// change code above this line
store.subscribe( () => count +=1 )
store.dispatch({type: ADD});
console.log(count);
store.dispatch({type: ADD});
console.log(count);
store.dispatch({type: ADD});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
.
Link to the challenge: