Modern way of adding new functionality to TypeScript libraries by patching existing modules
Oleg Varaksin
302

I was *just* noodling on this topic after monkey-patching the .allSettled() Promise method (inspired by Q) into the Bluebird promise library. After that, I started to think more generally about altering prototypes. And, just exactly as you were thinking, I started to think about how the way we handle RxJS “side-effect” imports in Angular solves the “unknown” problem of prototype augmentation (or Module augmentation). Now, it becomes clear how things are augmented and you don’t just have to trust that some init script was run somewhere that set everything up.

If I write about this, I’ll definitely link back to this article.