We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d69272f commit c8dd346Copy full SHA for c8dd346
src/main/kotlin/com/mvcoding/mvp/Presenter.kt
@@ -32,6 +32,8 @@ abstract class Presenter<VIEW : Presenter.View> {
32
viewSubscriptions.add(subscription)
33
}
34
35
+ protected fun <T> Observable<T>.subscribeUntilDetached() = subscribe().apply { unsubscribeOnDetach(this) }
36
+
37
protected fun <T> Observable<T>.subscribeUntilDetached(onNext: (T) -> Unit) = subscribe(onNext).apply { unsubscribeOnDetach(this) }
38
39
protected fun <T> Observable<T>.subscribeUntilDetached(onNext: (T) -> Unit, onError: (Throwable) -> Unit) =
0 commit comments