How JavaScript works: the publisher-subscriber pattern | Hacker News Reader