I'm trying to defer the initialization of okhttp c...
# koin
v
I'm trying to defer the initialization of okhttp client to the first network call. I think its possible to do something like this in Dagger. How do I achieve something similar with Koin ?
Copy code
@Provides
fun provideRetrofit(client: Lazy<OkHttpClient>): Retrofit {
    return Retrofit.Builder()
        .callFactory(object : Call.Factory {
            override fun newCall(request: Request): Call {
                return client.get().newCall(request)
            }

        })
        .build()
}
a
Koin is all lazy by default
did you try to declare it as a single?