Merge pull request #56 from TouchInstinct/small_fix

small fix
This commit is contained in:
Gavriil 2017-03-28 14:23:51 +03:00 committed by GitHub
commit 127476c2b0
1 changed files with 9 additions and 9 deletions

View File

@ -208,7 +208,6 @@ public class BaseLifecycleBindable implements LifecycleBindable {
return untilDestroy(single, onSuccessAction, getActionThrowableForAssertion(codePoint, UNTIL_DESTROY_METHOD));
}
@NonNull
@Override
public <T> Subscription untilDestroy(@NonNull final Single<T> single,
@ -252,19 +251,20 @@ public class BaseLifecycleBindable implements LifecycleBindable {
actualObservable = observable.observeOn(AndroidSchedulers.mainThread())
.doOnCompleted(onCompletedAction)
.doOnNext(onNextAction)
.doOnError(throwable -> {
final boolean isRxError = throwable instanceof OnErrorThrowable;
if ((!isRxError && throwable instanceof RuntimeException)
|| (isRxError && throwable.getCause() instanceof RuntimeException)) {
Lc.assertion(throwable);
}
onErrorAction.call(throwable);
});
.doOnError(onErrorAction);
}
return isCreatedSubject.first()
.switchMap(created -> created ? actualObservable : Observable.empty())
.takeUntil(conditionSubject.filter(condition -> condition))
.onErrorResumeNext(throwable -> {
final boolean isRxError = throwable instanceof OnErrorThrowable;
if ((!isRxError && throwable instanceof RuntimeException)
|| (isRxError && throwable.getCause() instanceof RuntimeException)) {
Lc.assertion(throwable);
}
return Observable.empty();
})
.subscribe();
}