I have a Single<?> that I would like to call .doOnNext() on. Why is this omitted? I get why .doOnCompleted() does not exist, but I want to call a void action once and there seems to be no simple way to do this with rx.Single
Technically I could call .map(), do my thing, and return the same object - but that seems like too much overhead. Or call .toObservable().doOnNext().toSingle(), but I cannot imagine that is too efficient.
Hi. The class received too little attention after it has been added to the library. The 1.x operators are kind of hanging off the Observable so currently you can't do better than map().
If you are interested, you can port back operators from the 2.x version (https://github.com/ReactiveX/RxJava/blob/2.x/src/main/java/io/reactivex/Single.java#L1073)
So I guess doOnSuccess() is the equivalent in Single for doOnNext() of Observable?
The doOnX matches the parent reactive type's terminology, thus Single has onSuccess -> doOnSuccess. Same for v2 Maybe.onSuccess.
Most helpful comment
The
doOnXmatches the parent reactive type's terminology, thusSinglehasonSuccess->doOnSuccess. Same for v2Maybe.onSuccess.