Created
July 14, 2021 07:28
-
-
Save HaHaBird/38fdbd9a18f0b102ec4458cb77ac5def to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <T> Observable<T>.autoDispose(provider: ScopeProvider): ObservableSubscribeProxy<T> = | |
this.`as`(AutoDispose.autoDisposable(provider)) | |
fun <T> Observable<T>.autoDispose(owner: LifecycleOwner, untilEvent: Lifecycle.Event = Lifecycle.Event.ON_DESTROY): ObservableSubscribeProxy<T> = | |
this.`as`(AutoDispose.autoDisposable(AndroidLifecycleScopeProvider.from(owner, untilEvent))) | |
fun <T> Flowable<T>.autoDispose(provider: ScopeProvider): FlowableSubscribeProxy<T> = | |
this.`as`(AutoDispose.autoDisposable(provider)) | |
fun <T> Flowable<T>.autoDispose(owner: LifecycleOwner, untilEvent: Lifecycle.Event = Lifecycle.Event.ON_DESTROY): FlowableSubscribeProxy<T> = | |
this.`as`(AutoDispose.autoDisposable(AndroidLifecycleScopeProvider.from(owner, untilEvent))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
需要依赖:
api 'com.uber.autodispose:autodispose:1.4.0'
api 'com.uber.autodispose:autodispose-android-archcomponents:1.4.0'
api 'com.uber.autodispose:autodispose-android-archcomponents-ktx:1.2.0'