public final class Subjects extends Object
Modifier and Type | Method and Description |
---|---|
static <T> @NonNull Subject<T> |
refCount(Subject<T> subject)
Wraps a Subject and makes sure if all observers dispose
their disposables, the upstream's Disposable gets disposed as well.
|
@NonNull @CheckReturnValue public static <T> @NonNull Subject<T> refCount(Subject<T> subject)
This operator is similar to ConnectableObservable.refCount()
except the first Observer doesn't trigger any sort of connection; that happens
when the resulting Subject is subscribed to an Observable manually.
T
- the input and output value typesubject
- the subject to wrap, not null