thepracticaldev.com thepracticaldev.com

Dependency Injection in TypeScript

The D letter in SOLID is the Dependency Inversion principle. It helps to decouple modules from each other so that you can easily swap one part of the code for another. One of the techniques that helps to follow this principle is Dependency Injection. This post was inspired by Sasha Bespoyasov's article and is partially a translation of it. What Are Dependencies? For ease of reference, we will define a dependency as any module...