2.x: switchMapSingle and switchMapCompletable #4853

Open
tomaszpolanski opened this Issue Nov 15, 2016 · 8 comments

Projects

None yet

3 participants

@tomaszpolanski
tomaszpolanski commented Nov 15, 2016 edited

Hey,

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?

Cheers

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

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.

@vanniktech
Contributor

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

@akarnokd
Member

Ah right. No plans for extending any other xMap operator

@vanniktech
Contributor

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
@tomaszpolanski

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?

@akarnokd
Member

Sure, but these operators are not easy.

@tomaszpolanski

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.

Cheers!

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