I wrote this repo to show how I would implement the observer pattern in JavaScript, it also includes an implementation written in TypeScript.
You can read the full blog post here.
You need to have Node.js installed.
npm install
To run the JavaScript implementation:
npm run start:js
To run the TypeScript implementation:
npm run start:ts
Released under the public domain, see LICENSE.