Reduce memory footprint of Hilt (#159)

* Remove @Singleton where it is not needed

* Use @AssistedFactory where possible
This commit is contained in:
Kirill Kamakin
2023-07-04 18:22:16 +02:00
committed by GitHub
parent 2bc2bb76e4
commit 2375be0329
55 changed files with 51 additions and 215 deletions

View File

@@ -14,13 +14,11 @@ import gq.kirmanak.mealient.datasource.BuildConfig
import gq.kirmanak.mealient.logging.Logger
import okhttp3.Interceptor
import okhttp3.logging.HttpLoggingInterceptor
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object DebugModule {
@Provides
@Singleton
@IntoSet
fun provideLoggingInterceptor(logger: Logger): Interceptor {
val interceptor = HttpLoggingInterceptor { message -> logger.v(tag = "OkHttp") { message } }
@@ -32,7 +30,6 @@ object DebugModule {
}
@Provides
@Singleton
@IntoSet
fun provideChuckerInterceptor(@ApplicationContext context: Context): Interceptor {
val collector = ChuckerCollector(