Dependency Injection using interfaces in JS

ref – https://github.com/RestlessThinker/Javascript-Interface/blob/master/interface.js

Interfaces in JS are implemented like so:

simply use them whenever you do Constructor dependency injection, or set dependency injection.

Make sure the incoming object implements the functions (duck typing). If it does, then that means the inner objects calls the methods (Inversion of control).

The allows you to easily test the container and the incoming part.