Okay, you’ve written your callback function:
const callback = () => {
count++;
}
But you still have to subscribe it to the store. To do it you can use store.subscribe()
.
For example the code below would log “Hello” to the console every time an action is dispatched against the store:
store.subscribe(() => {
console.log("Hello");
}