I have an RxJava Completable
that I want to execute, then chain to a Single<Long>
. I can write it like this:
return Completable.complete().toSingleDefault(0L).flatMap { Single.just(1L) }
但这似乎不必要地复杂.我本以为Completable#toSingle()
人就能胜任,但如果我写:
Completable.complete().toSingle { Single.just(1L) }
我会犯错误.Completable
中是否缺少功能,或者我忽略了什么?