2.x: switchMapSingle and switchMapCompletable #4853

tomaszpolanski opened this Issue Nov 15, 2016 · 8 comments


None yet

3 participants

tomaszpolanski commented Nov 15, 2016 edited


the addition of flatMapSingle/flatMapCompletable made the usage of Single and Completable way nicer in RxJava 2.
Do you consider adding switchMapSingle/switchMapCompletable to RxJava 2 as well?


@tomaszpolanski tomaszpolanski changed the title from switchMapSingle and switchMapCompletable to 2.x: switchMapSingle and switchMapCompletable Nov 15, 2016

You mean 1.x? I have no plans for that and I don't want to keep 1.x alive for too long. I'd like to stop enhancing 1.x in 6 months and enter it into a bugfix-only mode. Otherwise 3rd party libraries may delay their upgrade way longer.


He wants switchMapSingle and switchMapCompletable for RxJava 2 just like there is flatMapSingle and flatMapCompletable


Ah right. No plans for extending any other xMap operator


But then concatMap also needs the variants in order to be consistent. To be honest I forgot about those when proposing flatMapSingle / flatMapCompletable / flatMapMaybe initially - #4667

And then there's also Maybe. Plus Observable and Flowable are able of mapping so it's easily another 12 methods.

  • Observable.switchMapSingle
  • Observable.switchMapMaybe
  • Observable.switchMapCompletable
  • Observable.concatMapSingle
  • Observable.concatMapMaybe
  • Observable.concatMapCompletable
  • Flowable.switchMapSingle
  • Flowable.switchMapMaybe
  • Flowable.switchMapCompletable
  • Flowable.concatMapSingle
  • Flowable.concatMapMaybe
  • Flowable.concatMapCompletable

If it is not on the roadmap because you don't want to add any more xMap operators, then I understand.

But if it is due to lack of the time, would you consider accepting contributions on the topic?


Sure, but these operators are not easy.


Yes, I know, those are one of the hardest.
Still, I will at least have a look and see if I can deliver a PR.


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