mnasyrov / ditox

Dependency injection for modular web applications
https://ditox.js.org
MIT License
92 stars 8 forks source link

Multi factories support #30

Open BANOnotIT opened 1 year ago

BANOnotIT commented 1 year ago

You have bindMultivalue utill implemented and it's cool. But is there any way to implement multi factories that can traverse parent container also?

Use case is the following: A system with plugin architecture requires plugins to be initialized and returned to plugin consumer as array. This can be partially done using following:

Problems with this approach are following:

Is there some less fragile approach which doesn't involve the library API change or this feature can only be solved by adding things inside?

mnasyrov commented 1 year ago

Thanks for the idea, I'll need some time to think about it.