Reduce memory footprint of Hilt (#159)
* Remove @Singleton where it is not needed * Use @AssistedFactory where possible
This commit is contained in:
@@ -3,9 +3,7 @@ package gq.kirmanak.mealient.test
|
||||
import gq.kirmanak.mealient.logging.Logger
|
||||
import gq.kirmanak.mealient.logging.MessageSupplier
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class FakeLogger @Inject constructor() : Logger {
|
||||
override fun v(throwable: Throwable?, tag: String?, messageSupplier: MessageSupplier) {
|
||||
print("V", throwable, messageSupplier)
|
||||
|
||||
@@ -6,7 +6,6 @@ import dagger.hilt.components.SingletonComponent
|
||||
import dagger.hilt.testing.TestInstallIn
|
||||
import gq.kirmanak.mealient.logging.Logger
|
||||
import gq.kirmanak.mealient.logging.LoggingModule
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@TestInstallIn(
|
||||
@@ -16,6 +15,5 @@ import javax.inject.Singleton
|
||||
interface FakeLoggingModule {
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun bindFakeLogger(impl: FakeLogger): Logger
|
||||
}
|
||||
Reference in New Issue
Block a user