Hlw Everyone, need a suggestion regarding lazy inj...
# koin
a
Hlw Everyone, need a suggestion regarding lazy injection Is there any other way then below one, with below approach I always need to do
param.value
to access it
Copy code
internal class LoginViewModel(
    private val loginUserUseCase: Lazy<LoginUserUseCase>,
    private val dispatcherProvider: Lazy<DispatcherProvider>
)

LoginViewModel(inject(), inject())
CMIIW, but if we keep non-lazy normal variables and do
get()
, those are eagerly initialised?
p
a
@Pedro Francisco de Sousa Neto but while doing constructor injection we can't use delegate or can I? with field injection its fine
p
I don't think so. Do you've any idea @arnaud.giuliani?
a
field won't be delegated by using
inject
in constructor. Delegate form of
by inject()
is for property
then you have to deal with
Lazy<>
and
.value
a
got it thanks everyone