injector_io
injector_io copied to clipboard
Add support for interfaces
Is not possible to instantiate concrete classes from their base classes, this a severe limitation.
BaseClass base = get<BaseClass>(); // Instantiate ConcreteClass
The code below would probably be an API breaking change:
factory<CacheStore>(() => FileCacheStore(inject()))
Hello.
I was about to use this library.
Unfortunately, I realized during debugging that interface/abstract class injection is not supported.
W/o being able to resolve base classes from given implementations this library is useless for me.
Is there any progress on this issue already? Or is it better to check for a working alternative?
Hi @PDDStudio, thank you for bringing this topic to our attention as it was forgotten due to other priority tasks inside our company.
We'll see implement if possible in this week, but you're also welcome to contribute with a pull request.
Thank you.