File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
src/main/kotlin/com/mvcoding/mvp Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,13 @@ abstract class Presenter<VIEW : Presenter.View> {
33
33
}
34
34
35
35
protected fun <T > Observable<T>.subscribeUntilDetached (onNext : (T ) -> Unit ) = subscribe(onNext).apply { unsubscribeOnDetach(this ) }
36
+
36
37
protected fun <T > Observable<T>.subscribeUntilDetached (onNext : (T ) -> Unit , onError : (Throwable ) -> Unit ) =
37
38
subscribe(onNext, onError).apply { unsubscribeOnDetach(this ) }
38
39
40
+ protected fun <T > Observable<T>.subscribeUntilDetached (onNext : (T ) -> Unit , onError : (Throwable ) -> Unit , onComplete : () -> Unit ) =
41
+ subscribe(onNext, onError, onComplete).apply { unsubscribeOnDetach(this ) }
42
+
39
43
private fun ensureViewIsNotAttached (view : VIEW ) {
40
44
if (this .view != null ) throw IllegalStateException (" Cannot attach $view , because ${this .view} is already attached" )
41
45
}
You can’t perform that action at this time.
0 commit comments