How to convert rxJava2's Observable to Completable?

Stepango picture Stepango · Nov 3, 2016 · Viewed 13.4k times · Source

I have Observable stream, and I want to convert it to Completable, how I could do that?

Answer

akarnokd picture akarnokd · Nov 3, 2016

The fluent way is to use Observable.ignoreElements().

Observable.just(1, 2, 3)
.ignoreElements()

Convert it back via toObservable if needed.