Tell us what’s happening:
Describe your issue in detail here.
hi this my first time using react and the topic if I m not wrong its to building calling functions over react but can se the solution can any body help me with the code to see the solution
**Your code so far**
const ADD = 'ADD';
const reducer = (state = 0, action) => {
switch(action.type) {
case ADD:
return state + 1;
default:
return state;
}
};
const store = Redux.createStore(reducer);
// Global count variable:
let count = 1;
const addOne = () => (count += 1);
// Change code below this line
what should write here??
// Change code above this line
store.dispatch({type: ADD});
console.log(count);
store.dispatch({type: ADD});
console.log(count);
store.dispatch({type: ADD});
console.log(count);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53
Challenge: Register a Store Listener
Link to the challenge: