https://kotlinlang.org logo
#kodein
Title
# kodein
s

SrSouza

06/21/2022, 6:35 PM
Hi folks, I'm having a issue with Kodein.
2 bindings found that match bind<X>
One of the bindings directly bind
X
.
bind<X> scoped singleto { XImplementation()
another one uses X a delegate implementation.
Copy code
class YViewModel(val x: X) : X by x

bind<YViewModel> scoped singleton { YViewModel(x = instance()) }
I try to use
Bind(erased<YViewModel>())
but did not work, any workaround for this? I don't want YViewModel to be considered X (by considered I mean not being accesible through
instance<X>() = YViewModel
5 Views