You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Create an observable sequence that is the result of invoking the
5506
+
* selector on a connectable observable sequence that shares a single
5507
+
* subscription to the underlying sequence.
5508
+
* @param <R> the result type
5509
+
* @param selector function which can use the multicasted source
5510
+
* sequence as many times as needed, without causing multiple
5511
+
* subscriptions to the source sequence. Subscribers to the given
5512
+
* source will receive all notifications of the source from the time
5513
+
* of the subscription on.
5514
+
* @return an observable sequence that is the result of invoking the
5515
+
* selector on a connectable observable sequence that shares a single
5516
+
* subscription to the underlying sequence.
5517
+
*/
5518
+
public <R> Observable<R> publish(Func1<? superObservable<T>, ? extendsObservable<R>> selector) {
5519
+
returnmulticast(newFunc0<Subject<T, T>>() {
5520
+
@Override
5521
+
publicSubject<T, T> call() {
5522
+
returnPublishSubject.create();
5523
+
}
5524
+
}, selector);
5525
+
}
5526
+
5527
+
/**
5528
+
* Create an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
5529
+
* @param <R> the result type
5530
+
* @param selector function which can use the multicasted source
5531
+
* sequence as many times as needed, without causing multiple
5532
+
* subscriptions to the source sequence. Subscribers to the given
5533
+
* source will receive all notifications of the source from the time
5534
+
* of the subscription on
5535
+
* @param initialValue the initial value of the underlying BehaviorSubject
5536
+
* @return an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue
5537
+
*/
5538
+
public <R> Observable<R> publish(Func1<? superObservable<T>, ? extendsObservable<R>> selector, finalTinitialValue) {
5539
+
returnmulticast(newFunc0<Subject<T, T>>() {
5540
+
@Override
5541
+
publicSubject<T, T> call() {
5542
+
returnBehaviorSubject.create(initialValue);
5543
+
}
5544
+
}, selector);
5545
+
}
5546
+
5494
5547
/**
5495
5548
* Returns a {@link ConnectableObservable} that emits only the last item
5496
5549
* emitted by the source Observable.
@@ -5503,6 +5556,30 @@ public ConnectableObservable<T> publish() {
0 commit comments