Skip to content

Instantly share code, notes, and snippets.

@happy-bracket
Created January 26, 2020 18:59
Show Gist options
  • Save happy-bracket/f90bf112053084188dd82e19d53650ff to your computer and use it in GitHub Desktop.
Save happy-bracket/f90bf112053084188dd82e19d53650ff to your computer and use it in GitHub Desktop.
val src: List<Single<Unit>> = ...
fun sink(result: Single<Unit>) { ... }
src.map { it.toObservable().k() }
.sequence(ObservableK.applicative()).fix()
.map { Unit }
.observable
.firstElement()
.also(::sink)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment