-
-
Save nsk-mironov/5434a119481cca238df93ce04e82291b 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
fun <T> magic(jobs: Observable<Completable>, hot: Observable<T>): Observable<T> { | |
return jobs.startWith(Completable.never()).indexed().switchMap { | |
if (it.index == 0) hot else it.value.andThen(hot) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment