Skip to content

Commit 3973b96

Browse files
1.x: alias Observable.doOnCompleted to match Completable and 2x
Closes #3700.
1 parent 9f49624 commit 3973b96

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/main/java/rx/Completable.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,9 +1222,20 @@ public void onSubscribe(Subscription d) {
12221222
* @param onComplete the callback to call when this emits an onComplete event
12231223
* @return the new Completable instance
12241224
* @throws NullPointerException if onComplete is null
1225+
* @deprecated Use {@link #doOnCompleted(Action0)} instead.
12251226
*/
1226-
public final Completable doOnComplete(Action0 onComplete) {
1227-
return doOnLifecycle(Actions.empty(), Actions.empty(), onComplete, Actions.empty(), Actions.empty());
1227+
@Deprecated public final Completable doOnComplete(Action0 onComplete) {
1228+
return doOnCompleted(onComplete);
1229+
}
1230+
1231+
/**
1232+
* Returns a Completable which calls the given onCompleted callback if this Completable completes.
1233+
* @param onCompleted the callback to call when this emits an onComplete event
1234+
* @return the new Completable instance
1235+
* @throws NullPointerException if onComplete is null
1236+
*/
1237+
public final Completable doOnCompleted(Action0 onCompleted) {
1238+
return doOnLifecycle(Actions.empty(), Actions.empty(), onCompleted, Actions.empty(), Actions.empty());
12281239
}
12291240

12301241
/**

0 commit comments

Comments
 (0)