Implemented Completable#andThen(Observable)#3570
Conversation
|
Adding unit tests and pushing shortly. |
02434ef to
b92c664
Compare
There was a problem hiding this comment.
Completable already has an endWith overload with the same purpose.
There was a problem hiding this comment.
Is there a verdict on Observable.andThen? Renaming endWith to andThen may serve some consistency purpose among base classes.
There was a problem hiding this comment.
One initial motivation for andThen was based on the Option::and_then method in Rust stdlib. It chains through the computation and transforms it's type/contents to the next Option.
There was a problem hiding this comment.
My first thought was java.util.function.Function a; a.andThen(b). Also endWith doesn't end the composition this would look strange a.endWith(b).endWith(c) vs a.andThen(b).andThen(c).
There was a problem hiding this comment.
I think andThen is more idiomatic than endWith, especially for chaining purposes.
There was a problem hiding this comment.
I guess that if we are going to rename or change any of the public API on Completable now is the time before our next release. Should we aim to review the operators before next release?
There was a problem hiding this comment.
Lambdas are Java 8. Besides, there is already a Completable.error() and you should call cs.onSubscribe(Subscriptions.unsubscribed()) first.
b92c664 to
acaf42e
Compare
|
👍 |
Implemented Completable#andThen(Observable)
I expect some discussion around the method name.