Good explanation and good examples. While explaining the container concept to manage the DIs it looks very similar to the idea of using an autoloader that lets us just call a class without importing it. Are they the same or the autoloader is just another thing that makes making a DI container easier?
The examples were simple to follow. Thank you, sir. Two questions: 1. Can you recommend some resources to further my journey in DI, specifically in the context of JavaScript / TypeScript? 2. Is there a DI solution that resolves all the dependencies during the build process and generates static import/require statements in the build output for each file? I ask this because if the DI container resolves dependencies dynamically at runtime, then won't we lose the ability to tree-shake unused code?
@adiadiadi: I recommend NestJS as a nice DI/IoC implementation to play with and learn more about. As for your second question: I don't know of any such compile step, afaik all DI is resolved at runtime.
Thanks mate , you did it great!
thank you bran. this is exactly what i was looking for.
i love this. Thank you Bran
pretty neat ;) Thx a lot.
Thanks a lot
Good explanation and good examples. While explaining the container concept to manage the DIs it looks very similar to the idea of using an autoloader that lets us just call a class without importing it. Are they the same or the autoloader is just another thing that makes making a DI container easier?
The examples were simple to follow. Thank you, sir.
Two questions:
1. Can you recommend some resources to further my journey in DI, specifically in the context of JavaScript / TypeScript?
2. Is there a DI solution that resolves all the dependencies during the build process and generates static import/require statements in the build output for each file? I ask this because if the DI container resolves dependencies dynamically at runtime, then won't we lose the ability to tree-shake unused code?
@adiadiadi: I recommend NestJS as a nice DI/IoC implementation to play with and learn more about. As for your second question: I don't know of any such compile step, afaik all DI is resolved at runtime.
@@branvandermeer thanks! will check out Nest