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

2.x: convert the Observable operators to return Single/Maybe #4579

Merged
merged 1 commit into from
Sep 22, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Sep 22, 2016

This PR updates many Observable operators to return Single, Maybe or Completable:

  • count() -> Single
  • elementAt() -> Maybe
  • elementAt(T) -> Single
  • first(T) -> Single
  • firstElement() -> Maybe
  • ignoreElements() -> Completable
  • lastElement() -> Maybe
  • reduce(BiFunction) -> Maybe
  • reduce(Callable, BiFunction) -> Single
  • reduceWith(U, BiFunction) -> Single
  • single(T) -> Single
  • singleElement() -> Maybe

and deletes Observable.toSingle, Observable.toMaybe and Observable.toCompletable.

In addition, Flowable.reduce(BiFunction) now returns Maybe<T>.

Related: #4321

@akarnokd akarnokd added this to the 2.0 RC 3 milestone Sep 22, 2016
@akarnokd akarnokd force-pushed the ReturnSingleMaybe_922 branch from 6880855 to 3d87ee2 Compare September 22, 2016 10:12
@codecov-io
Copy link

codecov-io commented Sep 22, 2016

Current coverage is 77.96% (diff: 75.78%)

Merging #4579 into 2.x will decrease coverage by 0.54%

@@                2.x      #4579   diff @@
==========================================
  Files           545        552     +7   
  Lines         35941      36164   +223   
  Methods           0          0          
  Messages          0          0          
  Branches       5548       5575    +27   
==========================================
- Hits          28216      28194    -22   
- Misses         5714       5950   +236   
- Partials       2011       2020     +9   

Powered by Codecov. Last update 470eddb...3d87ee2

@akarnokd
Copy link
Member Author

Thanks @JakeWharton !

@akarnokd akarnokd merged commit 31ed500 into ReactiveX:2.x Sep 22, 2016
@akarnokd akarnokd deleted the ReturnSingleMaybe_922 branch September 22, 2016 13:39
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.

3 participants