mergeMap variations #6354
parloti
started this conversation in
Ideas / Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need three variations of the mergeMap operator as described below.
This operator would maintain a map of values obtained with keySelector and their respective internal active subscriptions. It would behave like the mergeMap, except if there is already an active subscription on the map for the value obtained with keySelector, in this case it should behave like the switchMap, canceling the active subscription and creating a new one.
Similar to switchEqualMap, but for repeated value of keySelector it should behave like exhaustMap instead of switchMap, maintaining the previous subscription and ignoring the current value.
It is also similar to switchEqualMap, but to repeated value of keySelector it should behave like concatMap instead of switchMap, waiting for the conclusion of the previous subscription to process the current value.
I'm already testing my own implementation for rxjs 6, like this HigherOrderMapOperator. But I want to migrate to rxjs 7, and my code is no longer compatible.
I would also be happy with a combination of existing operators that is simpler than this Cancel repeated subscription in mergeMap.
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions