com.uber.autodispose.kotlin.autodispose.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autodispose-kotlin Show documentation
Show all versions of autodispose-kotlin Show documentation
An RxJava utility library for auto-disposing observers.
The newest version!
/*
* Copyright (c) 2017. Uber Technologies
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("NOTHING_TO_INLINE")
package com.uber.autodispose.kotlin
import com.uber.autodispose.AutoDispose
import com.uber.autodispose.CompletableSubscribeProxy
import com.uber.autodispose.FlowableSubscribeProxy
import com.uber.autodispose.LifecycleScopeProvider
import com.uber.autodispose.MaybeSubscribeProxy
import com.uber.autodispose.ObservableSubscribeProxy
import com.uber.autodispose.ParallelFlowableSubscribeProxy
import com.uber.autodispose.ScopeProvider
import com.uber.autodispose.SingleSubscribeProxy
import io.reactivex.Completable
import io.reactivex.Flowable
import io.reactivex.Maybe
import io.reactivex.Observable
import io.reactivex.Single
import io.reactivex.annotations.CheckReturnValue
import io.reactivex.parallel.ParallelFlowable
import kotlin.DeprecationLevel.ERROR
/**
* Extension that proxies to [Flowable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(scope)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Flowable.autoDisposeWith(scope: Maybe<*>): FlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Observable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(scope)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Observable.autoDisposeWith(scope: Maybe<*>): ObservableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Single.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(scope)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Single.autoDisposeWith(scope: Maybe<*>): SingleSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Maybe.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(scope)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Maybe.autoDisposeWith(scope: Maybe<*>): MaybeSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Completable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(scope)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Completable.autoDisposeWith(scope: Maybe<*>): CompletableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Flowable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Flowable.autoDisposeWith(provider: ScopeProvider): FlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Observable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Observable.autoDisposeWith(provider: ScopeProvider): ObservableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Single.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Single.autoDisposeWith(provider: ScopeProvider): SingleSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Maybe.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Maybe.autoDisposeWith(provider: ScopeProvider): MaybeSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Completable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Completable.autoDisposeWith(provider: ScopeProvider): CompletableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Flowable.as] + [AutoDispose.autoDisposable]
*
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Flowable.autoDisposeWith(
provider: LifecycleScopeProvider<*>): FlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Observable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Observable.autoDisposeWith(
provider: LifecycleScopeProvider<*>): ObservableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Single.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Single.autoDisposeWith(
provider: LifecycleScopeProvider<*>): SingleSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Maybe.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Maybe.autoDisposeWith(provider: LifecycleScopeProvider<*>): MaybeSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Completable.as] + [AutoDispose.autoDisposable]
*/
@Deprecated(
level = ERROR,
message = "Replaced with autoDisposable() to match top level APIs.",
replaceWith = ReplaceWith("autoDisposable(provider)",
"com.uber.autodispose.kotlin.autoDisposable")
)
@CheckReturnValue
inline fun Completable.autoDisposeWith(
provider: LifecycleScopeProvider<*>): CompletableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Flowable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Flowable.autoDisposable(scope: Maybe<*>): FlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Observable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Observable.autoDisposable(scope: Maybe<*>): ObservableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Single.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Single.autoDisposable(scope: Maybe<*>): SingleSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Maybe.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Maybe.autoDisposable(scope: Maybe<*>): MaybeSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Completable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Completable.autoDisposable(scope: Maybe<*>): CompletableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [ParallelFlowable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun ParallelFlowable.autoDisposable(scope: Maybe<*>): ParallelFlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Flowable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Flowable.autoDisposable(provider: ScopeProvider): FlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Observable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Observable.autoDisposable(provider: ScopeProvider): ObservableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Single.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Single.autoDisposable(provider: ScopeProvider): SingleSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Maybe.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Maybe.autoDisposable(provider: ScopeProvider): MaybeSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Completable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Completable.autoDisposable(provider: ScopeProvider): CompletableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [ParallelFlowable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun ParallelFlowable.autoDisposable(provider: ScopeProvider): ParallelFlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Flowable.as] + [AutoDispose.autoDisposable]
*
*/
@CheckReturnValue
inline fun Flowable.autoDisposable(
provider: LifecycleScopeProvider<*>): FlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Observable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Observable.autoDisposable(
provider: LifecycleScopeProvider<*>): ObservableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Single.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Single.autoDisposable(
provider: LifecycleScopeProvider<*>): SingleSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Maybe.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Maybe.autoDisposable(provider: LifecycleScopeProvider<*>): MaybeSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [Completable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Completable.autoDisposable(
provider: LifecycleScopeProvider<*>): CompletableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))
/**
* Extension that proxies to [ParallelFlowable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun ParallelFlowable.autoDisposable(
provider: LifecycleScopeProvider<*>): ParallelFlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(provider))