In the past few months We made a simple and small Container library to use internally in the company that I'm currentlly working for. It is available in this repository on GitHub. You can try it and leave some feedback. We will keep it up because we are using it for real projects.
- Create singleton instances;
- Create factory instances (recreated on every call);
- Register instances using
- Get instances from anywhere using the
- Logs printed while in
- Easy to test.
- Doesn't use reflection.
- get() => Used to resolve the instance of a registered class.
- inject() => Used to resolve a dependency inside a Module.
single() => Used to register a singleton instance. You will receive a the same instance every time you use
factory() => Used to register a factory instance. You will receive a new instance every time you use
Read more here and give it a start.