1.x: Single.flatMapCompletable#4226
1.x: Single.flatMapCompletable#4226akarnokd merged 7 commits intoReactiveX:1.xfrom vanniktech:1.x_Single_flatMapCompletable
Conversation
Current coverage is 84.19% (diff: 100%)@@ 1.x #4226 diff @@
==========================================
Files 265 266 +1
Lines 17305 17335 +30
Methods 0 0
Messages 0 0
Branches 2624 2625 +1
==========================================
+ Hits 14559 14596 +37
+ Misses 1893 1887 -6
+ Partials 853 852 -1
|
|
The unsubscription is not properly linked, the possible exception thrown by the mapper is not handled. See this.
Yes. |
| return Observable.merge(asObservable(map(func))); | ||
| } | ||
|
|
||
| public final Completable flatMapCompletable(final Func1<? super T, ? extends Completable> func) { |
|
Updated the documentation. I hope the wording is okay now. Also I'm pointing to https://github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.flatMapCompletable.png which does not exist yet but @DavidMGross already tracked it at ReactiveX/reactivex.github.io#289, I hope that's okay. thanks for the |
| * @return the Completable returned from {@code func} when applied to the item emitted by the source Single | ||
| * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a> | ||
| */ | ||
| public final Completable flatMapCompletable(final Func1<? super T, ? extends Completable> func) { |
There was a problem hiding this comment.
You forgot to commit the class itself. Plus, use new CompletableFlatMapSingleToCompletable<T>(this, func) as it is a generic class.
There was a problem hiding this comment.
Yup I just comitted it. Got confused since I had to stage the files individually because of the star imports ...
|
|
||
| final Single<T> source; | ||
|
|
||
| final Func1<? super T, Completable> mapper; |
There was a problem hiding this comment.
You have to change this to ? extends Completable (and update the other places) so it compiles with the operator signature in Single
| * Completable | ||
| * @return the Completable returned from {@code func} when applied to the item emitted by the source Single | ||
| * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a> | ||
| */ |
There was a problem hiding this comment.
Please tag this as @Experimental.
|
👍 |
|
Would it be possible to get this one into 1.1.8? |
|
If @zsxwing or anyone from Netflix approves it in time. |
| return Observable.merge(asObservable(map(func))); | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
nit: {@link Completable}
|
👍 |
Addresses #4216
Happy to receive feedback on the implementation. Also should I take the documentation from
flatMapObservableand adjust it?