r/javascript • u/themisterdj • Dec 24 '16
The truth about Dependency injection!
https://develoger.com/the-truth-about-dependency-injection-70d715b36527#.cluegjb24
0
Upvotes
8
1
u/hotel2oscar Dec 25 '16
I've enjoyed proxyquire for when you want to mock out things that don't get passed in.
14
u/Strobljus Dec 25 '16
Sorry to be a buzzkill, but that's hardly DI. That's a callback. Even if you would be able to technically classify it as rudimentary DI, it is so far from the architectural pattern that is most often referred to as DI that it will only confuse newbies. "Angular uses DI? No worries, I read that blog. Wait what on earth is this?!".