# 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:** [Septembre 14, 2017, 3:44 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:** 11

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [Septembre 15, 2017, 8:00 UTC](https://meta.discourse.org/t/emojipicker-stores-state-in-global-module-level-variables/70056/11 "2017-09-15T08:00:56Z")

</div>

> [@schungx](#):
>
> A much better idea is to have one single PNG image with all these sprites. Then use a class to fetch the relevant background-position from CSS. This should make the emoji’s show up much quicker.

Incorrect, sprite sheets are a HTTP/1.1 optimization. This is also a fragile and complex techinque that breaks, say, simply linking to a given emoji. HTTP 2, which we already use and have for quite a few months, doesn’t require these contortions.

[https://mattwilcox.net/web-development/http2-for-front-end-web-developers](https://mattwilcox.net/web-development/http2-for-front-end-web-developers)

Now the advice “only load what is (currently) visible” is timeless, and damn I wish web browsers had implemented this back in 2002. (Try loading a long web page with 50 images, when 49 of them are not visible due to scroll position.)

---

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