thank you bran. this is exactly what i was looking for.
@tmbarral664 Жыл бұрын
pretty neat ;) Thx a lot.
@lpanebr9 ай бұрын
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?
@adiadiadi10 ай бұрын
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?
@branvandermeer10 ай бұрын
@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.