Skip to content

Instantly share code, notes, and snippets.

@cdsap
Last active April 16, 2018 10:59
Show Gist options
  • Save cdsap/22185d686cd2129bbe2c88cf62679aca to your computer and use it in GitHub Desktop.
Save cdsap/22185d686cd2129bbe2c88cf62679aca to your computer and use it in GitHub Desktop.
Partial impl AppMpdule Client
@Provides
@Singleton
fun providesSyncTrades(@Named("remote") getTradesRepositoryRemote: GetTradesRepository,
@Named("local") getTradesRepositoryLocal: GetTradesRepository): SyncTrades {
return SyncTradesImpl(getTradesRepositoryRemote, getTradesRepositoryLocal)
}
@Provides
@Singleton
fun providesGetTrades(@Named("remote") getTradesRepositoryRemote: GetTradesRepository,
@Named("local") getTradesRepositoryLocal: GetTradesRepository): GetTrades {
return GetTradesImpl(getTradesRepositoryRemote, getTradesRepositoryLocal)
}
@Provides
@Singleton
@Named("local")
fun providesGetTradesRepositoryLocal(db: DbInterface): GetTradesRepository {
return GetTradesLocalRepository(db)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment