▲ NestJS: The most beautifully handcrafted Node.js framework that we’ve all been waiting for! at matwrites.com▼28 up and 8 down, posted by swiss 2533 days ago 7 comments
mxxx 2532 days ago. link 2 points ▲ ▼I've never been 100% clear on why you'd want dependency injection in a situation like this... Can anyone elaborate on what the real benefits would be?
israelidanny 2529 days ago. link 4 points ▲ ▼You wouldn't ... Dependency Injection is a design pattern that circumvents some of the limitations of a static OOP language, which JS isn't ...
matsojda 2532 days ago. link 4 points ▲ ▼When you inject your dependencies, you can easily mock them in the test. Or change if needed. All you want to care about is the interface.