Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the height issue of the img tags #70

Merged
merged 4 commits into from
Dec 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ RxScala:

- The API documentation can be found [here](http://reactivex.io/rxscala/scaladoc/index.html#rx.lang.scala.Observable).

Note that starting from version 0.15, `rx.lang.scala.Observable` is not a value class any more. [./Rationale.md](https://github.com/Netflix/RxJava/blob/master/language-adaptors/rxjava-scala/Rationale.md) explains why.
Note that starting from version 0.15, `rx.lang.scala.Observable` is not a value class any more. [./Rationale.md](https://github.com/ReactiveX/RxScala/blob/0.x/Rationale.md) explains why.

You can build the API documentation yourself by running `sbt doc` in the RxScala root directory. Open `target/scala-2.11/api/index.html` to display it.

Expand Down
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a (probably incomplete) list of what still needs to be done in the Scala

TODOs which came up at the meeting with Erik Meijer on 2013-10-11:

* Rename the factory methods in `object Observable`, considering that the most important is the one taking an `Observer => Subscription` function (the "king" according to Erik). Thunk to Subscription conversion (?), also consider Jason's [comments](https://github.com/Netflix/RxJava/commit/c1596253fc5567b7cc37d20128374d189471ff79). A useful trick might also be to have `apply(T, T, T*)` instead of just `apply(T*)`.
* Rename the factory methods in `object Observable`, considering that the most important is the one taking an `Observer => Subscription` function (the "king" according to Erik). Thunk to Subscription conversion (?), also consider Jason's [comments](https://github.com/ReactiveX/RxJava/commit/c1596253fc5567b7cc37d20128374d189471ff79). A useful trick might also be to have `apply(T, T, T*)` instead of just `apply(T*)`.
* Factory methods for observables and instance methods should take implicit scheduler, default is different per method (Isn't this a contradiction? In other words: If I call a method without providing a scheduler, should the default scheduler be used or the implicit that I provided?) Find in .NET source the list of which schedulers goes with which operators by default. If no other default, use NewThreadScheduler. Note that there are methods in Scala Observable which should have an overload taking a Scheduler, but do not yet have it! Also remember Erik saying that he would like to "minimize magically injected concurrency".
* Convert executor to scheduler
* Check if TestScheduler added in 0.14.3 is sufficient
Expand All @@ -14,7 +14,7 @@ TODOs which came up at the meeting with Erik Meijer on 2013-10-11:
* Currently all Swing examples use Swing directly, without using the Scala wrappers around Swing. Make sure that everything is nice if the Scala wrappers around Swing are used, eg `Reaction { case clicked: ButtonClicked => … }` -- avoid default case, check out the hooks for partial function applyOrElse to avoid double pattern matching
* There are no examples yet using `async`, but `async` will be used in the course. Write examples and check if everything works as expected when combined with `async`.
* Futures: For the moment, just add a Future->Observable converter method to `object Observable`. Later, think if `Future[T] extends Observable[T]`.
* Operator `delay`: Once Erik has commented on [this](https://github.com/Netflix/RxJava/pull/384), make sure this operator is added accordingly to RxJava and then to RxScala
* Operator `delay`: Once Erik has commented on [this](https://github.com/ReactiveX/RxJava/pull/384), make sure this operator is added accordingly to RxJava and then to RxScala

Some more TODOs:

Expand Down
4 changes: 2 additions & 2 deletions examples/src/test/scala/rx/lang/scala/examples/Olympics.scala
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ object Olympics {
/*
def fourYearsEmptyOld: Observable[Medal] = {
// TODO this should return an observable which emits nothing during fourYears and then completes
// Because of https://github.com/Netflix/RxJava/issues/388, we get non-terminating tests
// And this https://github.com/Netflix/RxJava/pull/289#issuecomment-24738668 also causes problems
// Because of https://github.com/ReactiveX/RxJava/issues/388, we get non-terminating tests
// And this https://github.com/ReactiveX/RxJava/pull/289#issuecomment-24738668 also causes problems
// So we don't use this:
Observable.interval(fourYears).take(1).map(i => neverUsedDummyMedal).filter(m => false)
// But we just return empty, which completes immediately
Expand Down
Empty file.
413 changes: 204 additions & 209 deletions src/main/scala/rx/lang/scala/Observable.scala
100755 → 100644

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/main/scala/rx/lang/scala/Subject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ trait Subject[T] extends Observable[T] with Observer[T] {
* Subject that, once an `Observer` has subscribed, emits all subsequently observed items to the
* subscriber.
* <p>
* <img width="640" height="405" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/S.PublishSubject.png" alt="">
* <img width="640" height="405" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/S.PublishSubject.png" alt="" />
* <p>
* @example
{{{
Expand All @@ -61,4 +61,5 @@ object Subject {
* @return the new `Subject`
*/
def apply[T](): Subject[T] = new rx.lang.scala.subjects.PublishSubject[T](rx.subjects.PublishSubject.create())
}
}

25 changes: 12 additions & 13 deletions src/main/scala/rx/lang/scala/observables/BlockingObservable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* This is similar to {@link Observable#subscribe(Observer)}, but it blocks. Because it blocks it does
* not need the {@link Observer#onCompleted()} or {@link Observer#onError(Throwable)} methods.
*
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.forEach.png">
* <img width="640" height="330" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/B.forEach.png" alt="" />
*
* @param f
* the {@link Action1} to invoke for every item emitted by the {@link Observable}
Expand All @@ -61,12 +61,12 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* Returns the last item emitted by a specified [[Observable]], or
* throws `NoSuchElementException` if it emits no items.
*
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.last.png">
* <img width="640" height="315" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/B.last.png" alt="" />
*
* @return the last item emitted by the source [[Observable]]
* @throws NoSuchElementException
* if source contains no elements
* @see <a href="https://github.com/Netflix/RxJava/wiki/Blocking-Observable-Operators#last-and-lastordefault">RxJava Wiki: last()</a>
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators#last-and-lastordefault">RxJava Wiki: last()</a>
* @see <a href="http://msdn.microsoft.com/en-us/library/system.reactive.linq.observable.last.aspx">MSDN: Observable.Last</a>
*/
def last : T = {
Expand All @@ -88,7 +88,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* Returns the last item emitted by the source Observable, or a default item
* if the source Observable completes without emitting any items.
*
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/lastOrDefault.png">
* <img width="640" height="305" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/lastOrDefault.png" alt="" />
*
* @param default the default item to emit if the source Observable is empty.
* This is a by-name parameter, so it is only evaluated if the source Observable doesn't emit anything.
Expand All @@ -105,7 +105,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* @return the first item emitted by the source [[Observable]]
* @throws NoSuchElementException
* if source contains no elements
* @see <a href="https://github.com/Netflix/RxJava/wiki/Blocking-Observable-Operators#first-and-firstordefault">RxJava Wiki: first()</a>
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators#first-and-firstordefault">RxJava Wiki: first()</a>
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229177.aspx">MSDN: Observable.First</a>
*/
def first : T = {
Expand All @@ -119,7 +119,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* @return the first item emitted by the source [[Observable]]
* @throws NoSuchElementException
* if source contains no elements
* @see <a href="https://github.com/Netflix/RxJava/wiki/Blocking-Observable-Operators#first-and-firstordefault">RxJava Wiki: first()</a>
* @see <a href="https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators#first-and-firstordefault">RxJava Wiki: first()</a>
* @see <a href="http://msdn.microsoft.com/en-us/library/hh229177.aspx">MSDN: Observable.First</a>
* @see [[BlockingObservable.first]]
*/
Expand All @@ -139,7 +139,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
/**
* Returns the very first item emitted by the source Observable, or a default value if the source Observable is empty.
*
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/firstOrDefault.png">
* <img width="640" height="305" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/firstOrDefault.png" alt="" />
*
* @param default The default value to emit if the source Observable doesn't emit anything.
* This is a by-name parameter, so it is only evaluated if the source Observable doesn't emit anything.
Expand All @@ -152,7 +152,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
/**
* Returns an {@link Iterable} that always returns the item most recently emitted by an {@link Observable}.
* <p>
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.mostRecent.png">
* <img width="640" height="490" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/B.mostRecent.png" alt="" />
*
* @param initialValue
* the initial value that will be yielded by the {@link Iterable} sequence if the {@link Observable} has not yet emitted an item
Expand All @@ -167,7 +167,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* Returns an {@link Iterable} that blocks until the {@link Observable} emits another item,
* then returns that item.
* <p>
* <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.next.png">
* <img width="640" height="490" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/B.next.png" alt="" />
*
* @return an {@link Iterable} that blocks upon each iteration until the {@link Observable} emits a new item, whereupon the Iterable returns that item
*/
Expand All @@ -179,7 +179,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* If the source Observable completes after emitting a single item, return that item. If the source Observable
* emits more than one item or no items, notify of an `IllegalArgumentException` or `NoSuchElementException` respectively.
*
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/single.png">
* <img width="640" height="315" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/single.png" alt="" />
*
* @return an Observable that emits the single item emitted by the source Observable
* @throws IllegalArgumentException if the source emits more than one item
Expand Down Expand Up @@ -207,7 +207,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* if the source Observable is empty, return a default item. If the source Observable
* emits more than one item, throw an `IllegalArgumentException`.
*
* <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/singleOrDefault.png">
* <img width="640" height="315" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/singleOrDefault.png" alt="" />
*
* @param default a default value to emit if the source Observable emits no item.
* This is a by-name parameter, so it is only evaluated if the source Observable doesn't emit anything.
Expand Down Expand Up @@ -256,7 +256,7 @@ class BlockingObservable[+T] private[scala] (val o: Observable[T])
* is empty. Use `Observable.toSeq.toBlocking.toFuture` if you are not sure about the size of `BlockingObservable`
* and do not want to handle these `Exception`s.
*
* <img width="640" height="395" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/B.toFuture.png">
* <img width="640" height="395" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/B.toFuture.png" alt="" />
*
* @return a `Future` that expects a single item to be emitted by this `BlockingObservable`.
*/
Expand Down Expand Up @@ -285,4 +285,3 @@ private[observables] class WithFilter[+T] (p: T => Boolean, asJava: rx.observabl

}


4 changes: 2 additions & 2 deletions src/main/scala/rx/lang/scala/subjects/AsyncSubject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import rx.lang.scala.Subject
* Subject that publishes only the last item observed to each `Observer` that has subscribed, when the
* source `Observable}` completes.
* <p>
* <img width="640" height="405" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/S.AsyncSubject.png" alt="">
* <img width="640" height="405" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/S.AsyncSubject.png" alt="" />
* <p>
* @example
{{{
Expand Down Expand Up @@ -51,4 +51,4 @@ object AsyncSubject {
}
}

class AsyncSubject[T] private[scala] (val asJavaSubject: rx.subjects.AsyncSubject[T]) extends Subject[T] {}
class AsyncSubject[T] private[scala] (val asJavaSubject: rx.subjects.AsyncSubject[T]) extends Subject[T] {}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import rx.lang.scala.Subject
* Subject that emits the most recent item it has observed and all subsequent observed items to each subscribed
* `Observer`.
* <p>
* <img width="640" height="405" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/S.BehaviorSubject.png" alt="">
* <img width="640" height="405" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/S.BehaviorSubject.png" alt="" />
* <p>
* @example
{{{
Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/rx/lang/scala/subjects/PublishSubject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import rx.lang.scala.Subject
* Subject that, once an `Observer` has subscribed, emits all subsequently observed items to the
* subscriber.
* <p>
* <img width="640" height="405" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/S.PublishSubject.png" alt="">
* <img width="640" height="405" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/S.PublishSubject.png" alt="" />
* <p>
* @example
{{{
Expand All @@ -46,3 +46,4 @@ object PublishSubject {
}

private [scala] class PublishSubject[T] private [scala] (val asJavaSubject: rx.subjects.PublishSubject[T]) extends Subject[T] {}

3 changes: 2 additions & 1 deletion src/main/scala/rx/lang/scala/subjects/ReplaySubject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import scala.concurrent.duration.Duration
/**
* Subject that buffers all items it observes and replays them to any `Observer` that subscribes.
* <p>
* <img width="640" height="405" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/S.ReplaySubject.png" alt="">
* <img width="640" height="405" src="https://raw.githubusercontent.com/wiki/ReactiveX/RxJava/images/rx-operators/S.ReplaySubject.png" alt="" />
* <p>
* @example
{{{
Expand Down Expand Up @@ -153,3 +153,4 @@ object ReplaySubject {
}

class ReplaySubject[T] private[scala] (val asJavaSubject: rx.subjects.ReplaySubject[T]) extends Subject[T] {}