Is there variant of `factoryOf` where I pass imple...
# koin
e
Is there variant of
factoryOf
where I pass implementation constructor but injection key is the parent class?
1
Probably something like
Copy code
factory<Interface> { new(::Implementation) }
Yeah, this works
l
You can do it with
factoryOf
Copy code
factoryOf(::Implementation) bind Interface::class
e
Ah, thanks! Not sure which I like more 🙂
Off topic, now sure why they didn't name it
binds
that would be reading as normal English
l
binds
is used for an array of binding
koinscroll 1
You can also do
Copy code
factoryOf(::Implementation) { bind<Interface>() }
If you want an other option 🙂
e
Thanks!