Skip to content

Instantly share code, notes, and snippets.

@Urdzik
Created April 1, 2020 03:07
Show Gist options
  • Save Urdzik/94448f859d5e8a70d6ca154b43e96f29 to your computer and use it in GitHub Desktop.
Save Urdzik/94448f859d5e8a70d6ca154b43e96f29 to your computer and use it in GitHub Desktop.
bool1.withLatestFrom(bool2, BiFunction<Boolean, Boolean, Boolean> { t1, t2 -> t1 && t2 })
.doAfterNext { voidFun() }.onErrorReturnItem(false)
.switchMap { item -> return@switchMap if (item) {
Flowable.create({ sub ->
num.filter { number -> number % 2 == 0 }.take(1)
.subscribeOn(Schedulers.computation())
.map { (1.0 / it).toString() }.subscribe(
{
sub.onNext(it)
}, { error ->
Log.e("TAG", error.localizedMessage)
})
}, BackpressureStrategy.MISSING)
} else Flowable.just("") }
.observeOn(Schedulers.newThread())
.doOnNext {
println("Ура ${Thread.currentThread().name}")
}
.subscribeOn(Schedulers.io())
.subscribe { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment