Using:
- lit-html (by https://twitter.com/justinfagnani): https://github.com/Polymer/lit-html
- lit-html-element (by https://twitter.com/kennethrohde): https://github.com/kenchris/lit-element
This is just one of many ways a singleton/service could be done in simple JavaScript. It can be useful when managing resources that can only have one instance, e.g. hardware control that needs to be connected to from multiple elements.