Echo JS 0.11.0

<~>
tracker1 3103 days ago. link 1 point
Still not a fan of DI in JS, especially with it's easy module system... it's easy enough to export a single instance in a module, and if you only need one instance, then you can create a wrapper that everything else imports that give you the instantiated instance explicitly.

DI systems make it hard to track down where something came from, makes for disconnected code that's often harder to debug and test against, and in general is usually a complexity that is best avoided.

DI makes far more sense in a statically typed environment that requires certain types of inheritance for testing.  Although it *may* provide value if you're writing your tests in TypeScript, I would emphatically *not* use this for JS.

Replies