Reduce memory footprint of Hilt (#159)
* Remove @Singleton where it is not needed * Use @AssistedFactory where possible
This commit is contained in:
@@ -26,11 +26,9 @@ internal interface DatabaseModule {
|
||||
.build()
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideRecipeDao(db: AppDb): RecipeDao = db.recipeDao()
|
||||
}
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun provideRecipeStorage(recipeStorageImpl: RecipeStorageImpl): RecipeStorage
|
||||
}
|
||||
@@ -10,9 +10,7 @@ import gq.kirmanak.mealient.database.recipe.entity.RecipeSummaryEntity
|
||||
import gq.kirmanak.mealient.database.recipe.entity.RecipeWithSummaryAndIngredientsAndInstructions
|
||||
import gq.kirmanak.mealient.logging.Logger
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
internal class RecipeStorageImpl @Inject constructor(
|
||||
private val db: AppDb,
|
||||
private val logger: Logger,
|
||||
|
||||
Reference in New Issue
Block a user