# EmojiPicker stores state in global module-level variables

**URL:** <https://meta.discourse.org/t/emojipicker-stores-state-in-global-module-level-variables/70056>\
**Category:** Bug\
**Created:** [September 14, 2017, 3:44pm UTC](https://meta.discourse.org/t/emojipicker-stores-state-in-global-module-level-variables/70056 "2017-09-14T15:44:03Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![schungx](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/schungx/32/70989_2.png) [@schungx](https://meta.discourse.org/u/schungx)\
**Post date:** [September 15, 2017, 5:21am UTC](https://meta.discourse.org/t/emojipicker-stores-state-in-global-module-level-variables/70056/9 "2017-09-15T05:21:05Z")

</div>

Your commit here is what’s breaking everything:

[https://github.com/discourse/discourse/commit/6a4d74d9f8681038ea1b273c173308b2fbd0f687#diff-2eadf5f693f654ff37f740c2904219a2](https://github.com/discourse/discourse/commit/6a4d74d9f8681038ea1b273c173308b2fbd0f687#diff-2eadf5f693f654ff37f740c2904219a2)

You attempted to optimize by caching some values, but caching them into module-global variables. Should have cached them into instance properties.

---

_[View the full topic](https://meta.discourse.org/t/emojipicker-stores-state-in-global-module-level-variables/70056)._
