Skip to content

Commit 49fa4af

Browse files
author
Michiel Vermeersch
committed
Fixed Completable.blockingSubscribeBy
1 parent dec5250 commit 49fa4af

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/main/kotlin/io/reactivex/rxkotlin3/subscribers.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,4 @@ fun <T : Any> Single<T>.blockingSubscribeBy(
135135
fun Completable.blockingSubscribeBy(
136136
onError: (Throwable) -> Unit = onErrorStub,
137137
onComplete: () -> Unit = onCompleteStub
138-
): Disposable = when {
139-
// There are optimized versions of the completable Consumers, so we need to use the subscribe overloads here.
140-
onError === onErrorStub && onComplete === onCompleteStub -> subscribe()
141-
onError === onErrorStub -> subscribe(onComplete)
142-
else -> subscribe(onComplete.asOnCompleteAction(), Consumer(onError))
143-
}
138+
): Unit = blockingSubscribe(onComplete.asOnCompleteAction(), onError.asOnErrorConsumer())

0 commit comments

Comments
 (0)