Skip to content

Commit 02434ef

Browse files
author
Aaron Tull
committed
Implemented Completable#andThen(Observable)
1 parent 0c039ee commit 02434ef

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/java/rx/Completable.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,21 @@ public final Completable compose(CompletableTransformer transformer) {
10801080
return to(transformer);
10811081
}
10821082

1083+
/**
1084+
* Returns an Observable which will subscribe to this Completable and once that is completed then
1085+
* will subscribe to the {@code next} Observable. An error event from this Completable will be
1086+
* propagated to the downstream subscriber and will result in skipping the subscription of the
1087+
* Observable.
1088+
*
1089+
* @param next the Observable to subscribe after this Completable is completed, not null
1090+
* @return Observable that composes this Completable and next
1091+
* @throws NullPointerException if next is null
1092+
*/
1093+
public final <T> Observable<T> andThen(Observable<T> next) {
1094+
requireNonNull(next);
1095+
return next.delaySubscription(toObservable());
1096+
}
1097+
10831098
/**
10841099
* Concatenates this Completable with another Completable.
10851100
* @param other the other Completable, not null

0 commit comments

Comments
 (0)