▲ 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 2496 days ago 7 comments
mxxx 2495 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 2492 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 2495 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.