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: Add Flowable.switchMap{Maybe,Single}{DelayError} operators #5873

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Mar 1, 2018

This PR adds Flowable operators that allow switching between a mapped sequence of Maybes or Singles, with or without delaying their errors:

  • switchMapMaybe
  • switchMapMaybeDelayError
  • switchMapSingle
  • switchMapSingleDelayError

They are in the same PR as the Single variant's implementation is practically the Maybe implementation minus the onComplete case.

Their marbles will be updated in a separate PR.

Originally requested in #4853.

@akarnokd akarnokd added this to the 2.2 milestone Mar 1, 2018
@codecov
Copy link

codecov bot commented Mar 1, 2018

Codecov Report

Merging #5873 into 2.x will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5873      +/-   ##
============================================
+ Coverage     96.57%   96.62%   +0.05%     
- Complexity     5881     5893      +12     
============================================
  Files           650      652       +2     
  Lines         43156    43403     +247     
  Branches       5994     6033      +39     
============================================
+ Hits          41677    41938     +261     
+ Misses          567      557      -10     
+ Partials        912      908       -4
Impacted Files Coverage Δ Complexity Δ
src/main/java/io/reactivex/Flowable.java 100% <100%> (ø) 557 <5> (+4) ⬆️
...ernal/operators/mixed/FlowableSwitchMapSingle.java 100% <100%> (ø) 2 <2> (?)
...ternal/operators/mixed/FlowableSwitchMapMaybe.java 100% <100%> (ø) 2 <2> (?)
...ernal/operators/flowable/FlowableFlatMapMaybe.java 90.82% <0%> (-5.32%) 2% <0%> (ø)
...activex/internal/observers/QueueDrainObserver.java 61.53% <0%> (-2.57%) 12% <0%> (-1%)
...ternal/operators/completable/CompletableMerge.java 96.42% <0%> (-2.39%) 2% <0%> (ø)
...rnal/operators/flowable/FlowableSkipLastTimed.java 95.91% <0%> (-2.05%) 2% <0%> (ø)
...nternal/operators/observable/ObservableWindow.java 98% <0%> (-2%) 3% <0%> (ø)
...ex/internal/subscribers/InnerQueuedSubscriber.java 96.07% <0%> (-1.97%) 18% <0%> (-1%)
...rnal/subscriptions/DeferredScalarSubscription.java 98.46% <0%> (-1.54%) 28% <0%> (-1%)
... and 31 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44fb7cd...bd6c41b. Read the comment docs.

Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

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

Which other operators are still missing?

@akarnokd
Copy link
Member Author

akarnokd commented Mar 1, 2018

  1. Observable.concatMapCompletableDelayError
  2. Observable.concatMapMaybe
  3. Observable.concatMapMaybeDelayError
  4. Observable.concatMapSingle
  5. Observable.concatMapSingleDelayError
  6. Observable.switchMapCompletable
  7. Observable.switchMapCompletableDelayError
  8. Observable.switchMapMaybe
  9. Observable.switchMapMaybeDelayError
  10. Observable.switchMapSingle - dedicated implementation
  11. Observable.switchMapSingleDelayError - dedicated implementation

These can be derived easily from their Flowable counterparts.

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.

2 participants