You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At one point, there was some performance advantage to having mapTo, concatMapTo, switchMapTo, et al. Because they introduced a way to map to the same value over and over again, without introducing a closure.
Now:
Closures are much faster.
Therefor the whole library is written in such a way that is uses closures.
Considering that mergeMapTo(x) and mergeMap(() => x) do pretty much the same thing, only one is hiding the closure, I thikn we should deprecate the MapTo variants to help clean up the core API.
This is genius. The documentation becomes easier to digest for newcomers and operators are easier to discover. And push developers into writing their first operator themself to harness the full potential of rxjs, as @backbone87 already mentioned, having a mapTo is kinda useful :)
Activity
backbone87 commentedon May 12, 2021
some usages experience a decrease in ergonomy:
personally, I have used this behavior on a few occasions. this isn't a big deal, just wanted to make sure this case is considered.
benlesh commentedon May 19, 2021
Core Team meeting:
👍 to deprecate
❓ Maybe not remove until version 9 (@kwonoj)
sod commentedon Jul 2, 2021
This is genius. The documentation becomes easier to digest for newcomers and operators are easier to discover. And push developers into writing their first operator themself to harness the full potential of rxjs, as @backbone87 already mentioned, having a
mapTois kinda useful :)update dependencies and code
update dependencies and code
update dependencies and code
update dependencies and code
chore: deprecate MapTo variants
chore: revert `switchMapTo`s back to `switchMap`
chore: do not use `mapTo`s variants
chore: deprecate MapTo variants (ReactiveX#6860)