Skip to content

2.x: Add singleOrError, firstOrError, lastOrError & elementAtOrError to Observable and Flowable#4589

Merged
akarnokd merged 2 commits intoReactiveX:2.xfrom
vanniktech:2.x_add_single_error_overloads
Sep 23, 2016
Merged

2.x: Add singleOrError, firstOrError, lastOrError & elementAtOrError to Observable and Flowable#4589
akarnokd merged 2 commits intoReactiveX:2.xfrom
vanniktech:2.x_add_single_error_overloads

Conversation

@vanniktech
Copy link
Collaborator

Closes #4588

Copy link
Member

@akarnokd akarnokd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

done = true;
actual.onSuccess(defaultValue);

if (defaultValue != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T v = defaultValue;
if (v != null) {
   actual.onSuccess(v);
} else {

if (index <= count && !done) {
done = true;
actual.onSuccess(defaultValue);
if (defaultValue != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read into T v

@akarnokd akarnokd added this to the 2.0 RC4 milestone Sep 23, 2016
@akarnokd
Copy link
Member

There are javadoc mistakes btw.

@vanniktech
Copy link
Collaborator Author

Yup I saw them and I'll fix them up. I didn't execute that test locally. (running all tests take forever on my local machine)

@codecov-io
Copy link

codecov-io commented Sep 23, 2016

Current coverage is 78.10% (diff: 100%)

Merging #4589 into 2.x will increase coverage by 0.05%

@@                2.x      #4589   diff @@
==========================================
  Files           552        552          
  Lines         36247      36272    +25   
  Methods           0          0          
  Messages          0          0          
  Branches       5594       5601     +7   
==========================================
+ Hits          28293      28332    +39   
+ Misses         5944       5923    -21   
- Partials       2010       2017     +7   

Powered by Codecov. Last update 7791076...88eb0cc

@akarnokd
Copy link
Member

Oh, this broke because of the error fixes.

/cc @JakeWharton and @abersnaze on naming/functionality.

@akarnokd akarnokd merged commit 603f6c6 into ReactiveX:2.x Sep 23, 2016
@vanniktech vanniktech deleted the 2.x_add_single_error_overloads branch September 23, 2016 21:31
Copy link

@PraveenNanda124 PraveenNanda124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants