Rxjs: Rename all operators that are duplicates of static operators to `xWith` variants

Created on 16 Jul 2018  路  8Comments  路  Source: ReactiveX/rxjs

concat -> concatWith
zip -> zipWith
merge -> mergeWith

etc.

Related #3798

discussion

Most helpful comment

Go for it, one thing less that can cause confusion. While at this, can you make it so that (Not sure this is possible at all) the old operators can't be found anymore by the auto-import tools in editors?
Every now and then I lose a bit of time because my auto-import tool imported the wrong thing.

All 8 comments

The plan here, of course, is to add aliases and deprecations in the short term.

Go for it, one thing less that can cause confusion. While at this, can you make it so that (Not sure this is possible at all) the old operators can't be found anymore by the auto-import tools in editors?
Every now and then I lose a bit of time because my auto-import tool imported the wrong thing.

I ran into this over the weekend, and spent several hours trying to work out why concat wasn't working as expected when I was inadvertently importing the rxjs/operators one. Semantically, I think using ...With is clearer too.

As someone that spends a fair bit of time introducing people to rxjs, this is an early pain point. While the two import locations make sense once you're experienced, it's something that seems really arbitrary early on, and the type errors you get from it are not helpful or enlightening to beginners. And even for experienced users it degrades the editor experience... Would be awesome to see fixed in v7!

I think renaming them is a good idea because this confusion keeps popping on StackOverflow regularly and from the error it throws it's not obvious what you're doing wrong.

I'm now thinking if when some static operators like merge are marked as deprecated does this issue mean that they won't be deprecated and just renamed?

@benlesh
Is the renaming still a thing? I really really hope so!!!!

Following things should be considered:

  • combineLatest, merge, concat, zip got deprecated in version 6.0.0-rc.0 and should be removed
  • race got deprecated in version 6.2.0 and should be removed
Was this page helpful?
0 / 5 - 0 ratings

Related issues

benlesh picture benlesh  路  3Comments

cartant picture cartant  路  3Comments

jakovljevic-mladen picture jakovljevic-mladen  路  3Comments

peterbakonyi05 picture peterbakonyi05  路  4Comments

LittleFox94 picture LittleFox94  路  3Comments