File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1457,6 +1457,22 @@ trait Observable[+T]
1457
1457
toScalaObservable[T ](asJavaObservable.cache())
1458
1458
}
1459
1459
1460
+ /**
1461
+ * Returns a new [[Observable ]] that multicasts (shares) the original [[Observable ]]. As long a
1462
+ * there is more than 1 [[Subscriber ]], this [[Observable ]] will be subscribed and emitting data.
1463
+ * When all subscribers have unsubscribed it will unsubscribe from the source [[Observable ]].
1464
+ *
1465
+ * This is an alias for `publish().refCount()`
1466
+ *
1467
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/publishRefCount.png">
1468
+ *
1469
+ * @return a [[Observable ]] that upon connection causes the source Observable to emit items to its [[Subscriber ]]s
1470
+ * @since 0.19
1471
+ */
1472
+ def share : Observable [T ] = {
1473
+ toScalaObservable[T ](asJavaObservable.share())
1474
+ }
1475
+
1460
1476
/**
1461
1477
* Returns an Observable that emits a Boolean that indicates whether the source Observable emitted a
1462
1478
* specified item.
You can’t perform that action at this time.
0 commit comments