Skip to content

Commit 5ec7133

Browse files
lukestephensonLuke Stephenson
authored andcommitted
Correct documentation for Observable.merge
Fixes #158
1 parent b418590 commit 5ec7133

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import scala.reflect.ClassTag
3434
* The Observable interface that implements the Reactive Pattern.
3535
*
3636
* @define subscribeObserverMain
37-
* Call this method to subscribe an [[rx.lang.scala.Observer]] for receiving
37+
* Call this method to subscribe an [[rx.lang.scala.Observer]] for receiving
3838
* items and notifications from the Observable.
3939
*
4040
* A typical implementation of `subscribe` does the following:
@@ -50,9 +50,9 @@ import scala.reflect.ClassTag
5050
* `Observable[T]` implementation indicates otherwise, Observers should make no
5151
* assumptions about the order in which multiple Observers will receive their notifications.
5252
*
53-
* @define subscribeObserverParamObserver
53+
* @define subscribeObserverParamObserver
5454
* the observer
55-
* @define subscribeObserverParamScheduler
55+
* @define subscribeObserverParamScheduler
5656
* the [[rx.lang.scala.Scheduler]] on which Observers subscribe to the Observable
5757
*
5858
* @define subscribeSubscriberMain
@@ -76,7 +76,7 @@ import scala.reflect.ClassTag
7676
* @define subscribeSubscriberParamScheduler
7777
* the [[rx.lang.scala.Scheduler]] on which [[Subscriber]]s subscribe to the Observable
7878
*
79-
* @define subscribeAllReturn
79+
* @define subscribeAllReturn
8080
* a [[rx.lang.scala.Subscription]] reference whose `unsubscribe` method can be called to stop receiving items
8181
* before the Observable has finished sending them
8282
*
@@ -86,7 +86,7 @@ import scala.reflect.ClassTag
8686
* @define subscribeCallbacksMainNoNotifications
8787
* Call this method to receive items from this observable.
8888
*
89-
* @define subscribeCallbacksParamOnNext
89+
* @define subscribeCallbacksParamOnNext
9090
* this function will be called whenever the Observable emits an item
9191
* @define subscribeCallbacksParamOnError
9292
* this function will be called if an error occurs
@@ -244,7 +244,7 @@ trait Observable[+T]
244244
def subscribe(onNext: T => Unit, onError: Throwable => Unit, onCompleted: () => Unit): Subscription = {
245245
asJavaObservable.subscribe(
246246
scalaFunction1ProducingUnitToAction1(onNext),
247-
scalaFunction1ProducingUnitToAction1(onError),
247+
scalaFunction1ProducingUnitToAction1(onError),
248248
scalaFunction0ProducingUnitToAction0(onCompleted)
249249
)
250250
}
@@ -359,7 +359,7 @@ trait Observable[+T]
359359
* with timestamps provided by the given Scheduler.
360360
* <p>
361361
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/timestamp.s.png" alt="" />
362-
*
362+
*
363363
* @param scheduler [[rx.lang.scala.Scheduler]] to use as a time source.
364364
* @return an Observable that emits timestamped items from the source
365365
* Observable with timestamps provided by the given Scheduler
@@ -370,8 +370,8 @@ trait Observable[+T]
370370
}
371371

372372
/**
373-
* Returns an Observable formed from this Observable and another Observable by combining
374-
* corresponding elements in pairs.
373+
* Returns an Observable formed from this Observable and another Observable by combining
374+
* corresponding elements in pairs.
375375
* The number of `onNext` invocations of the resulting `Observable[(T, U)]`
376376
* is the minumum of the number of `onNext` invocations of `this` and `that`.
377377
*
@@ -434,7 +434,7 @@ trait Observable[+T]
434434
/**
435435
* Zips this Observable with its indices.
436436
*
437-
* @return An Observable emitting pairs consisting of all elements of this Observable paired with
437+
* @return An Observable emitting pairs consisting of all elements of this Observable paired with
438438
* their index. Indices start at 0.
439439
*/
440440
def zipWithIndex: Observable[(T, Int)] = {
@@ -1111,7 +1111,7 @@ trait Observable[+T]
11111111
* transforming the [[rx.lang.scala.Notification]] objects emitted by the source Observable into the items
11121112
* or notifications they represent.
11131113
*
1114-
* This operation is only available if `this` is of type `Observable[Notification[U]]` for some `U`,
1114+
* This operation is only available if `this` is of type `Observable[Notification[U]]` for some `U`,
11151115
* otherwise you will get a compilation error.
11161116
*
11171117
* <img width="640" height="335" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/dematerialize.png" alt="" />
@@ -1142,7 +1142,7 @@ trait Observable[+T]
11421142
* function that returns an Observable (`resumeFunction`) to
11431143
* `onErrorResumeNext`, if the original Observable encounters an error, instead of
11441144
* invoking its Observer's `onError` method, it will instead relinquish control to
1145-
* the Observable returned from `resumeFunction`, which will invoke the Observer's
1145+
* the Observable returned from `resumeFunction`, which will invoke the Observer's
11461146
* [[rx.lang.scala.Observer.onNext onNext]] method if it is able to do so. In such a case, because no
11471147
* Observable necessarily invokes `onError`, the Observer may never know that an
11481148
* error happened.
@@ -1546,7 +1546,7 @@ trait Observable[+T]
15461546
* When you call `cache`, it does not yet subscribe to the
15471547
* source Observable. This only happens when `subscribe` is called
15481548
* the first time on the Observable returned by `cache`.
1549-
*
1549+
*
15501550
* Note: You sacrifice the ability to unsubscribe from the origin when you use the
15511551
* `cache()` operator so be careful not to use this operator on Observables that
15521552
* emit an infinite or very large number of items that will use up memory.
@@ -1930,7 +1930,7 @@ trait Observable[+T]
19301930
*
19311931
* <img width="640" height="305" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/take.png" alt="" />
19321932
*
1933-
* This method returns an Observable that will invoke a subscribing [[rx.lang.scala.Observer]]'s
1933+
* This method returns an Observable that will invoke a subscribing [[rx.lang.scala.Observer]]'s
19341934
* [[rx.lang.scala.Observer.onNext onNext]] function a maximum of `num` times before invoking
19351935
* [[rx.lang.scala.Observer.onCompleted onCompleted]].
19361936
*
@@ -2091,7 +2091,7 @@ trait Observable[+T]
20912091
*
20922092
* <img width="640" height="305" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.png" alt="" />
20932093
*
2094-
* Normally, an Observable that returns multiple items will do so by invoking its [[rx.lang.scala.Observer]]'s
2094+
* Normally, an Observable that returns multiple items will do so by invoking its [[rx.lang.scala.Observer]]'s
20952095
* [[rx.lang.scala.Observer.onNext onNext]] method for each such item. You can change
20962096
* this behavior, instructing the Observable to compose a list of all of these items and then to
20972097
* invoke the Observer's `onNext` function once, passing it the entire list, by
@@ -2278,8 +2278,8 @@ trait Observable[+T]
22782278
*
22792279
* @param that
22802280
* an Observable to be merged
2281-
* @return an Observable that emits items from `this` and `that` until
2282-
* `this` or `that` emits `onError` or `onComplete`.
2281+
* @return an Observable that emits items from `this` and `that` until
2282+
* `this` or `that` emits `onError` or both Observables emit `onCompleted`.
22832283
*/
22842284
def merge[U >: T](that: Observable[U]): Observable[U] = {
22852285
val thisJava: rx.Observable[_ <: U] = this.asJavaObservable
@@ -2675,7 +2675,7 @@ trait Observable[+T]
26752675
* <img width="640" height="400" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout4.png" alt="" />
26762676
* </p>
26772677
* Note: The arrival of the first source item is never timed out.
2678-
*
2678+
*
26792679
* @param timeoutSelector
26802680
* a function that returns an observable for each item emitted by the source
26812681
* Observable and that determines the timeout window for the subsequent item
@@ -2822,7 +2822,7 @@ trait Observable[+T]
28222822
* `NoSuchElementException` if the source Observable is empty.
28232823
* <p>
28242824
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/first.png" alt="" />
2825-
*
2825+
*
28262826
* @return an Observable that emits only the very first item emitted by the source Observable, or raises an
28272827
* `NoSuchElementException` if the source Observable is empty
28282828
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Filtering-Observables#wiki-first">RxJava Wiki: first()</a>
@@ -2837,7 +2837,7 @@ trait Observable[+T]
28372837
* `NoSuchElementException` if the source Observable is empty.
28382838
* <p>
28392839
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/first.png" alt="" />
2840-
*
2840+
*
28412841
* @return an Observable that emits only the very first item emitted by the source Observable, or raises an
28422842
* `NoSuchElementException` if the source Observable is empty
28432843
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Filtering-Observables#wiki-first">RxJava Wiki: first()</a>
@@ -2886,9 +2886,9 @@ trait Observable[+T]
28862886
/**
28872887
* Returns an Observable that emits the last item emitted by the source Observable or notifies observers of
28882888
* an `NoSuchElementException` if the source Observable is empty.
2889-
*
2889+
*
28902890
* <img width="640" height="305" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/last.png" alt="" />
2891-
*
2891+
*
28922892
* @return an Observable that emits the last item from the source Observable or notifies observers of an
28932893
* error
28942894
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Filtering-Observable-Operators#wiki-last">RxJava Wiki: last()</a>
@@ -2930,9 +2930,9 @@ trait Observable[+T]
29302930
* If the source Observable completes after emitting a single item, return an Observable that emits that
29312931
* item. If the source Observable emits more than one item or no items, notify of an `IllegalArgumentException`
29322932
* or `NoSuchElementException` respectively.
2933-
*
2933+
*
29342934
* <img width="640" height="315" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/single.png" alt="" />
2935-
*
2935+
*
29362936
* @return an Observable that emits the single item emitted by the source Observable
29372937
* @throws IllegalArgumentException if the source emits more than one item
29382938
* @throws NoSuchElementException if the source emits no items
@@ -3571,7 +3571,7 @@ trait Observable[+T]
35713571
* specified delay. Error notifications from the source Observable are not delayed.
35723572
*
35733573
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.png" alt="" />
3574-
*
3574+
*
35753575
* @param delay the delay to shift the source by
35763576
* @return the source Observable shifted in time by the specified delay
35773577
*/
@@ -3584,7 +3584,7 @@ trait Observable[+T]
35843584
* specified delay. Error notifications from the source Observable are not delayed.
35853585
*
35863586
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.s.png" alt="" />
3587-
*
3587+
*
35883588
* @param delay the delay to shift the source by
35893589
* @param scheduler the Scheduler to use for delaying
35903590
* @return the source Observable shifted in time by the specified delay
@@ -3648,7 +3648,7 @@ trait Observable[+T]
36483648
* Return an Observable that delays the subscription to the source Observable by a given amount of time.
36493649
*
36503650
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/delaySubscription.png" alt="" />
3651-
*
3651+
*
36523652
* @param delay the time to delay the subscription
36533653
* @return an Observable that delays the subscription to the source Observable by the given amount
36543654
*/
@@ -3661,7 +3661,7 @@ trait Observable[+T]
36613661
* both waiting and subscribing on a given Scheduler.
36623662
*
36633663
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/delaySubscription.s.png" alt="" />
3664-
*
3664+
*
36653665
* @param delay the time to delay the subscription
36663666
* @param scheduler the Scheduler on which the waiting and subscription will happen
36673667
* @return an Observable that delays the subscription to the source Observable by a given
@@ -3700,9 +3700,9 @@ trait Observable[+T]
37003700
/**
37013701
* Returns an Observable that emits the single item at a specified index in a sequence of emissions from a
37023702
* source Observbable.
3703-
*
3703+
*
37043704
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/elementAt.png" alt="" />
3705-
*
3705+
*
37063706
* @param index
37073707
* the zero-based index of the item to retrieve
37083708
* @return an Observable that emits a single item: the item at the specified position in the sequence of
@@ -3718,9 +3718,9 @@ trait Observable[+T]
37183718
/**
37193719
* Returns an Observable that emits the item found at a specified index in a sequence of emissions from a
37203720
* source Observable, or a default item if that index is out of range.
3721-
*
3721+
*
37223722
* <img width="640" height="310" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/elementAtOrDefault.png" alt="" />
3723-
*
3723+
*
37243724
* @param index
37253725
* the zero-based index of the item to retrieve
37263726
* @param default
@@ -4365,7 +4365,7 @@ object Observable {
43654365
`o => Subscription{}` have both of these types.
43664366
So we call the old create method "create", and the new create method "apply".
43674367
Try it out yourself here:
4368-
def foo[T]: Unit = {
4368+
def foo[T]: Unit = {
43694369
val fMeant: Observer[T] => Subscription = o => Subscription{}
43704370
val fWrong: Subscriber[T] => Unit = o => Subscription{}
43714371
}
@@ -4402,7 +4402,7 @@ object Observable {
44024402
def apply[T](f: Subscriber[T] => Unit): Observable[T] = {
44034403
toScalaObservable(rx.Observable.create(f))
44044404
}
4405-
4405+
44064406
/**
44074407
* Returns an Observable that invokes an [[rx.lang.scala.Observer]]'s [[rx.lang.scala.Observer.onError onError]]
44084408
* method when the Observer subscribes to it.

0 commit comments

Comments
 (0)