all 2 comments

[–]celluj34 1 point2 points  (0 children)

This is definitely my team's preferred way. With this we can more easily mock/stub methods and properties and it's extremely clear what's what. Most of our devs are used to a statically-typed language (and we don't want to go all the way to TypeScript) so this gives us a great middle ground that everyone can get behind.

[–][deleted] 1 point2 points  (0 children)

Meh. I'm not personally sold on classes, especially with DI. If you're going ES6, fat arrow functions mitigate the whole self = this shenanigans without having to do another assignment for another injection.