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 installTo run the JavaScript implementation:
npm run start:jsTo run the TypeScript implementation:
npm run start:tsReleased under the public domain, see LICENSE.