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

Operator: Last #470

Merged
merged 2 commits into from
Nov 7, 2013
Merged

Commits on Nov 7, 2013

  1. Last operator

    Equivalent to lastAsync in Rx.Net.
    benjchristensen committed Nov 7, 2013
    Configuration menu
    Copy the full SHA
    11af5d6 View commit details
    Browse the repository at this point in the history
  2. Fix behavior of BlockingObservable.last

    It now throws an IllegalArgumentException instead of returning null if no elements are emitted.
    
    This is based on feedback from @headinthebox confirming this expected behavior:
    
    var xs = Observable.Range(1,0);                       		// empty sequence
    int x = xs.Last().Dump();                             		// throws “sequence contains no elements”       RxJava => BlockingObservable.last()
    IObservable<int> ys = xs.TakeLast(1).Dump();          // OnCompleted()                                                RxJava => Observable.takeLast(1)
    IObservable<int> zs = xs.LastAsync().Dump();          // OnError(“sequence contains no elements”)    RxJava => Observable.last()
    benjchristensen committed Nov 7, 2013
    Configuration menu
    Copy the full SHA
    997546f View commit details
    Browse the repository at this point in the history