
com.uber.autodispose.AutoDispose.kt Maven / Gradle / Ivy
/*
* Copyright (C) 2018. 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
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
/**
* Extension that proxies to [Flowable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Flowable.autoDisposable(scope: Completable): FlowableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Observable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Observable.autoDisposable(scope: Completable): ObservableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Single.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Single.autoDisposable(scope: Completable): SingleSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Maybe.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Maybe.autoDisposable(scope: Completable): MaybeSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [Completable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun Completable.autoDisposable(scope: Completable): CompletableSubscribeProxy
= this.`as`(AutoDispose.autoDisposable(scope))
/**
* Extension that proxies to [ParallelFlowable.as] + [AutoDispose.autoDisposable]
*/
@CheckReturnValue
inline fun ParallelFlowable.autoDisposable(scope: Completable): 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))
© 2015 - 2025 Weber Informatics LLC | Privacy Policy