-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Implemented the 'any' operator #385
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
Conversation
RxJava-pull-requests #284 SUCCESS |
I haven't looked at the first question yet, but on the second one we'll likely need to stop importing |
Sorry that I missed the keyword |
RxJava-pull-requests #285 ABORTED |
I tested the C# I found the description in my VS is I always did some tests for using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reactive.Linq; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var any = Observable.Empty().Any(); any.Subscribe( x => Console.WriteLine("subscriber got " + x) // subscriber got False ); any = Observable.Range(1, 5).Any(); any.Subscribe( x => Console.WriteLine("subscriber got " + x) // subscriber got True ); any = Observable.Empty().Any( x => true ); any.Subscribe( x => Console.WriteLine("subscriber got " + x) // subscriber got False ); any = Observable.Range(1, 5).Any( x => x > 3 ); any.Subscribe( x => Console.WriteLine("subscriber got " + x) // subscriber got True ); any = Observable.Range(1, 5).Any( x => x > 5 ); any.Subscribe( x => Console.WriteLine("subscriber got " + x) // subscriber got False ); Console.ReadLine(); } } } Here is the output: subscriber got False subscriber got True subscriber got False subscriber got True subscriber got False In summary,
|
I have implemented the correct 'any' operator. Please take a look. Thanks! |
RxJava-pull-requests #286 ABORTED |
In Scala, we will probably use |
@zsxwing I don't have time tonight but will definitely get to this in the near future, thank you for getting involved! |
This implements the operator
Any
from #24 in all two variants.However, I encountered two problems.
Updated: the online document http://msdn.microsoft.com/en-us/library/hh211993(v=vs.103).aspx is wrong. See my later discussion.
Another question is if I add the
any
method torx.Observable<T>
, some unit tests will fail as the methodany
inrx.Observable<T>
overrides the methodorg.mockito.Matchers.any(java.lang.Class<T>)
in some unit tests (e.g.,rx.subjects.ReplaySubject<T>
). Do I need to use another method name, or just modify the unit tests? Now theany
methods inrx.Observable<T>
are commented out.Thanks.