@@ -21,7 +21,7 @@ trait Observer[-T] {
21
21
def onCompleted (): Unit
22
22
}
23
23
24
- object Observer {… }
24
+ object Observer {... }
25
25
```
26
26
27
27
To create an instance of say ` Observer[String] ` in user code, you can create a new instance of the ` Observer ` trait
@@ -41,7 +41,7 @@ Note that typically you do not need to create an `Observer` since all of the met
41
41
` onNext ` , ` onError ` , and ` onCompleted ` and will automatically create an ` Observer ` for you under the covers.
42
42
43
43
While * technically* it is a breaking change make the ` asJavaObserver ` property
44
- private, you should probably not have touched ` asjavaObserver ` in the first place.
44
+ private, you should probably not have touched ` asJavaObserver ` in the first place.
45
45
46
46
Observable
47
47
----------
@@ -104,14 +104,14 @@ Schedulers
104
104
105
105
The biggest breaking change compared to the 0.15.1 release is giving ` Scheduler ` the same structure as the other types.
106
106
The trait itself remains unchanged, except that we made the underlying Java representation hidden as above.
107
- The scheduler package has been renamed from ` rx.lang.scala.schedulers ` to ` rx.lang.scala.schedulers ` .
107
+ The scheduler package has been renamed from ` rx.lang.scala.concurrency ` to ` rx.lang.scala.schedulers ` .
108
108
109
109
``` scala
110
110
trait Scheduler {
111
111
private [scala] def asJavaScheduler : rx.Scheduler ;
112
112
}
113
113
114
- private [scala] object Scheduler {… }
114
+ private [scala] object Scheduler {... }
115
115
```
116
116
117
117
In the previous release, you created schedulers by selecting them from the ` Schedulers ` object,
@@ -165,28 +165,28 @@ object Subscription {...}
165
165
* ` MultipleAssignmentSubscription `
166
166
* ` SerialSubscription `
167
167
168
- In case you do feel tempted to call ` new Subscription{ ...} ` directly make sure you wire up ` isUnsubscribed `
168
+ In case you do feel tempted to call ` new Subscription{...} ` directly make sure you wire up ` isUnsubscribed `
169
169
and with the ` unsubscribed ` field properly, but for all practical purposes you should just use one of the factory methods.
170
170
171
171
Notifications
172
172
-------------
173
173
174
174
All underlying wrapped ` Java ` types in the ` Notification ` trait are made private like all previous types. The companion
175
- ` Notification ` now has both constructor and destructor functions:
175
+ objects of ` Notification ` now have both constructor ( ` apply ` ) and extractor ( ` unapply ` ) functions:
176
176
177
177
``` scala
178
- object Notification {… }
178
+ object Notification {... }
179
179
trait Notification [+ T ] {
180
180
private [scala] def asJavaNotification : rx.Notification [_ <: T ]
181
181
}
182
182
183
183
object Notification {
184
- object OnNext { def apply (...){}; def unapply (..){...} }
185
- object OnError { def apply (...){}; def unapply (..){...} }
186
- object OnCompleted { def apply (...){}; def unapply (..){...} }
184
+ object OnNext { def apply (...){}; def unapply (... ){...} }
185
+ object OnError { def apply (...){}; def unapply (... ){...} }
186
+ object OnCompleted { def apply (...){}; def unapply (... ){...} }
187
187
}
188
188
```
189
- To construct a ` Notification ` , you use ` Notification.OnNext("hello") ` , or ` Notification. OnError` (new Exception("Oops!"))`.
189
+ To construct a ` Notification ` , you import ` rx.lang.scala. Notification._ ` and use ` OnNext("hello") ` , or ` OnError(new Exception("Oops!")) ` , or ` OnCompleted( )` .
190
190
To pattern match on a notification you can create a partial function like so: ` case OnNext(v) => { ... v ... } ` .
191
191
192
192
There are no breaking changes for notifications.
0 commit comments