Angga Ardinata
02/29/2024, 4:53 AMval ktorfitModule = module {
single<Ktorfit> {
ktorfit {
// my config
}
}
}
then i used the ktorfit singleton in my child/service module like this
single<AuthService> {
val ktorfit : Ktorfit = get()
ktorfit.create()
}
and it works and compiled without any issue .. but when i try to do with annotations
AppModule
@Module(includes = [ServiceAuthModule::class])
@ComponentScan("com.ft.ats")
class AppModule {
@Single
fun getKtorfit(): Ktorfit {
return ktorfit {
// my config
}
}
}
Service Module
@Module
@ComponentScan("com.ats")
class ServiceAuthModule {
@Single
fun authService(ktorfit: Ktorfit) : AuthService = ktorfit.create()
@Single
fun getRepository(service: AuthService) : AuthRepository = AuthRepositoryImpl(service)
}
now its not compiled ..
im using this method both with Hilt and koin dsl without annotations and it has no problem ..
what am i missing ?Angga Ardinata
02/29/2024, 8:10 AMPedro Francisco de Sousa Neto
02/29/2024, 2:13 PMAngga Ardinata
02/29/2024, 2:16 PMPedro Francisco de Sousa Neto
02/29/2024, 2:21 PMstartKoin
? Something like:
startKoin { modules(ServiceAuthModule().module) }
Angga Ardinata
02/29/2024, 2:22 PMarnaud.giuliani
03/05/2024, 11:12 AMAngga Ardinata
03/06/2024, 9:33 AMarnaud.giuliani
03/08/2024, 8:47 AMarnaud.giuliani
03/08/2024, 8:48 AM