Skip to content

2.x: add subscribeWith to get back the subscriber/observer fluently #4422

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

Merged
merged 1 commit into from
Aug 24, 2016

Conversation

akarnokd
Copy link
Member

This PR adds the subscribeWith methods to the base reactive types to mainly help with the 1.x to 2.x changeover as 2.x subscribe(Subscriber) return void instead of the resource/cancellation/unsubscription type Disposable. See the javadocs and the unit test for example use.

Related: #4400

@akarnokd akarnokd added this to the 2.0 RC 1 milestone Aug 24, 2016
@codecov-io
Copy link

codecov-io commented Aug 24, 2016

Current coverage is 69.56% (diff: 100%)

Merging #4422 into 2.x will increase coverage by 0.04%

@@                2.x      #4422   diff @@
==========================================
  Files           454        454          
  Lines         32323      32331     +8   
  Methods           0          0          
  Messages          0          0          
  Branches       5214       5214          
==========================================
+ Hits          22470      22491    +21   
+ Misses         7651       7640    -11   
+ Partials       2202       2200     -2   

Powered by Codecov. Last update 7aa0b34...2f68644

@JakeWharton
Copy link
Contributor

👍

@akarnokd akarnokd merged commit 7e0f6d8 into ReactiveX:2.x Aug 24, 2016
@akarnokd akarnokd deleted the SubscribeWith branch August 24, 2016 22:49
* @throws NullPointerException if {@code observer} is null
* @since 2.0
*/
public final <E extends CompletableObserver> E subscribeWith(E observer) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

will there also be an overload that only takes onComplete? Or something that takes 2 arguments, onComplete & onError?

Copy link
Member Author

Choose a reason for hiding this comment

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

See the lines below.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ups 😕 thanks

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