https://kotlinlang.org logo
#dagger
Title
# dagger
k

Kareem Radwan

03/07/2022, 11:44 AM
Hi All, I have an abstract class and I need inject LruCache instance on each anonymous instance. anyone can help me? I am using Hilt with Kotlin
on this Way I got a error, but when I inject the cache on ViewModel for example it’s work without exceptions
j

Javier

03/07/2022, 12:05 PM
I should avoid not using constructor
then you can just
@Binds
that
abstract class
with the implementation in the Dagger module
k

Kareem Radwan

03/07/2022, 12:34 PM
ok I will check that
@Binds