Reduce memory footprint of Hilt (#159)
* Remove @Singleton where it is not needed * Use @AssistedFactory where possible
This commit is contained in:
@@ -50,9 +50,7 @@ import gq.kirmanak.mealient.datasource.v1.models.VersionResponseV1
|
||||
import gq.kirmanak.mealient.datastore.recipe.AddRecipeDraft
|
||||
import java.util.UUID
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class ModelMapperImpl @Inject constructor() : ModelMapper {
|
||||
|
||||
|
||||
|
||||
@@ -4,13 +4,11 @@ import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
interface ModelMapperModule {
|
||||
|
||||
@Binds
|
||||
@Singleton
|
||||
fun bindModelMapper(impl: ModelMapperImpl): ModelMapper
|
||||
}
|
||||
Reference in New Issue
Block a user