# Error : The callback to store.subscribe should also increment the global count variable as the store is updated

**URL:** <https://forum.freecodecamp.org/t/error-the-callback-to-store-subscribe-should-also-increment-the-global-count-variable-as-the-store-is-updated/447525>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [February 21, 2021, 6:24am UTC](https://forum.freecodecamp.org/t/error-the-callback-to-store-subscribe-should-also-increment-the-global-count-variable-as-the-store-is-updated/447525 "2021-02-21T06:24:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sitek94](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sitek94/32/336491_2.png) [@sitek94](https://forum.freecodecamp.org/u/sitek94)\
**Post date:** [February 21, 2021, 8:42am UTC](https://forum.freecodecamp.org/t/error-the-callback-to-store-subscribe-should-also-increment-the-global-count-variable-as-the-store-is-updated/447525/2 "2021-02-21T08:42:55Z")

</div>

I have answered already to your first topic here:

> [@https://www.freecodecamp.org/learn/front-end-libraries/redux/register-a-store-listener](https://forum.freecodecamp.org/t/https-www-freecodecamp-org-learn-front-end-libraries-redux-register-a-store-listener/447420/2):
>
> 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"); }

---

_[View the full topic](https://forum.freecodecamp.org/t/error-the-callback-to-store-subscribe-should-also-increment-the-global-count-variable-as-the-store-is-updated/447525)._
