Skip to content

Instantly share code, notes, and snippets.

@agustarc
Created August 15, 2019 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agustarc/bc99acb1bd09e0e314e2ef31054fd661 to your computer and use it in GitHub Desktop.
Save agustarc/bc99acb1bd09e0e314e2ef31054fd661 to your computer and use it in GitHub Desktop.
internal class ImagesRepositoryImpl(private val source: ImageDataSource) : ImagesRepository {
override fun getImages(params: Map<String, String>): Single<Result<ImagesResponse>> {
return source.getImages(params)
.map { Result.success(it) }
.onErrorResumeNext { Single.just(Result.failure(it)) }
.compose(applyRetryPolicy(TIMEOUT) { Single.just(Result.failure(it)) })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment