Improve descriptions of the *map operators #6818
deanrad
started this conversation in
Report issues other than bug
Replies: 1 comment
-
Do people look at discussions? I know we were suggested to start here, but the 🦗 ... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation of the timing operators
mergeMap
,concatMap
,switchMap
andexhaustMap
is confusing. I've never heard that descriptions like these are illuminating:Everyone I know learns the operators from secondary sources - the docs could be improved to address that (the current descriptions are 5 years old).
I suspect the confusion is partly because the descriptions focus only on the emitted values, neglecting to mention the subscriptions used to control those values. It seems more descriptive of what's going on to include the Subscriptions, and to talk about their concurrency - an important factor in choosing them..
Objective: Update the description of each timing operator to reflect what they do more plainly.
Here are the proposed edits, I'd love to get other input or votes on this.
Note: - A comment that could be included in each - is that after piping through one of these operators, the resulting Observable immediately emits when any of its subscriptions does.
switchMap
The description of
switchMap
in terms of subscriptions could be:concatMap
The description of
concatMap
in terms of subscriptions could be:mergeMap
The description of
mergeMap
in terms of subscriptions could be:exhaustMap
The description of
exhaustMap
in terms of subscriptions could be:There is actually a useful table showing the relation of these operators (and suggesting that a 5th, toggling operator could exist!). Im including that, as I've used it in explanations before and it may have a place in the docs as well.
mergeMap
concatMap
exhaustMap
switchMap
toggleMap
?Beta Was this translation helpful? Give feedback.
All reactions