Created
June 19, 2018 12:33
-
-
Save ppicas/83ec703a71638c77ffc6c5b811f52c70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface PushUpdates { | |
val jobs: Observable<Job> | |
} | |
class SubscribedJobRepository( | |
private val delegate: JobRepository, | |
private val pushUpdates: PushUpdates | |
) : JobRepository by delegate { | |
override fun getJob(jobId: String): Observable<Job> { | |
return delegate.getJob(jobId) | |
.concatWith(pushUpdates.jobs.filter { | |
it.id == jobId | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment