Hello developers! Today, we're going to create a News application using the MVVM design pattern, Retrofit for network calls, Hilt for dependency injection, and the modern UI toolkit Jetpack Compose for the user interface. Let's dive in and have some ...

Roger Colque Calcina
#android-dev #js-dev
hello i saw other way @Module @InstallIn(SingletonComponent::class) object RepositoriesModule {
@Provides @Singleton fun provideNewsRepository( apiService: NewsApiService ): NewsRepository = NewsRepositoryImpl ( apiService) } -
class NewsRepositoryImpl ( private val apiService: NewsApiService
) : NewsRepository {....
VS
@Module @InstallIn(SingletonComponent::class) abstract class RepositoryModule {
@Binds abstract fun bindNewsRepository( impl: NewsRepositoryImpl ): NewsRepository } -
class NewsRepositoryImpl @Inject constructor( private val apiService: NewsApiService
) : NewsRepository {....
Basically use bind for repos and singleton only for retrofit room
why not this way?