Disposable Scope
Represents a scope of Disposables. All scoped Disposables are disposed when the DisposableScope is disposed.
The following factory functions are available:
DisposableScope()
Functions
Link copied to clipboard
Adds the provided block callback to the scope. The callback will be called when the scope is disposed.
Link copied to clipboard
abstract fun Completable.subscribeScoped(onSubscribe: (Disposable) -> Unit? = null, onError: (Throwable) -> Unit? = null, onComplete: () -> Unit? = null): Disposable
Same as Completable.subscribe but also adds the Disposable to the scope
abstract fun <T> Single<T>.subscribeScoped(onSubscribe: (Disposable) -> Unit? = null, onError: (Throwable) -> Unit? = null, onSuccess: (T) -> Unit? = null): Disposable
Same as Single.subscribe but also adds the Disposable to the scope
abstract fun <T> Maybe<T>.subscribeScoped(onSubscribe: (Disposable) -> Unit? = null, onError: (Throwable) -> Unit? = null, onComplete: () -> Unit? = null, onSuccess: (T) -> Unit? = null): Disposable
Same as Maybe.subscribe but also adds the Disposable to the scope
abstract fun <T> Observable<T>.subscribeScoped(onSubscribe: (Disposable) -> Unit? = null, onError: (Throwable) -> Unit? = null, onComplete: () -> Unit? = null, onNext: (T) -> Unit? = null): Disposable
Same as Observable.subscribe but also adds the Disposable to the scope