Skip to content

Instantly share code, notes, and snippets.

@Tagakov
Forked from nsk-mironov/Magic.kt
Last active May 23, 2017 20:02
Show Gist options
  • Save Tagakov/6268260c9a1de1b1ed297b6e98ddaf1f to your computer and use it in GitHub Desktop.
Save Tagakov/6268260c9a1de1b1ed297b6e98ddaf1f to your computer and use it in GitHub Desktop.
fun <T> magic(jobs: Observable<Completable>, hot: Observable<T>): Observable<T> {
return Observable.switchOnNext(jobs.map { it.andThen(hot) }.startWith(hot))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment