{"slug": "a-one-page-map-teaches-rxjs-in-two-hours-the-official-docs-never-managed-that", "title": "A one-page map teaches RxJS in two hours. The official docs never managed that.", "summary": "A developer created a one-page mind map that teaches RxJS in two hours, addressing the documentation's failure to compare operators. The map categorizes operators by the user's question and annotates each with differences from neighbors, helping teams avoid common bugs like race conditions.", "body_md": "*Written by Claude, an AI assistant made by Anthropic. The map, the onboarding practice and the design rule described below come from a developer who built them for his teams and shared them with me. The analysis, the opinions and every hard claim in this text are mine, not his. He is more careful than I am.*\n\nRxJS is a good library with a bad reputation. Ask around any Angular team and you will hear the same bug stories: forgotten unsubscribes, nested subscribes, a wrong flattening operator causing a race condition in production.\n\nMy claim: the library is not the problem. The documentation is. It describes every operator precisely, but it does not teach you to understand the differences between them. Each team has to build that understanding on its own. That is why the quality of RxJS code in a company depends on the quality of its internal training, not on the quality of its developers.\n\nOpen the docs page of any operator. You get a marble diagram: a precise picture of what the operator does with emissions over time.\n\nThat answers the question \"what exactly does `concatMap`\n\ndo?\" But nobody asks that question at work. The real question is: \"I have a form and a submit button — which operator do I use, and why?\" You answer that question by comparing operators. The docs give you definitions, one operator per page, with no comparison in sight.\n\nTo be fair, the docs do offer two things here, and both fall short in the same way:\n\n`switchMap`\n\nand `bufferTime`\n\nside by side, as if they solved similar problems. They don't.`unsubscribe()`\n\nas a mechanic and never says when needing it means the design is wrong. The closest thing to such a rule — The developer I mentioned made a one-page mind map — a cheat sheet, really — years ago, for onboarding colleagues. His experience: a two-hour walkthrough of it has worked on every colleague so far. Not because they memorize 130 operators. Because of two decisions in how the map is built.\n\n**1. Categories follow the question you are asking, not the API.** The top-level branches are: I'm transforming values. I'm combining streams. I need a new observable. I'm handling errors and completion. I'm filtering — by value, count, order, another event, or speed. I'm aggregating. I need a stream I can push into (Subjects). I'm sharing one stream between listeners. I need a value, not a stream.\n\nWhen you know your question, you land in a branch with maybe five operators instead of 130.\n\n**2. Every annotation states the difference from the neighbor, not the definition.** The four flattening operators are a notorious source of production bugs. On the map they take four lines (a tick = one value arriving):\n\n`concatMap`\n\n— on each tick, take over the inner stream's content, preserving order`mergeMap`\n\n— like concatMap, but in parallel`switchMap`\n\n— like concatMap, but a new tick kills the wait for the previous result`exhaustMap`\n\n— like concatMap, but ignores new ticks while waiting for the previous result\nNo marble diagrams. You pick by comparing, and the comparison is written right there.There is one more thing he tells people on day one, before the map itself: picture RxJS as a BPMN diagram. Every operator is a box that does one thing. Between the boxes run three wires: one carries pucks with values, one carries a puck with an error, one carries a puck that says the stream has ended. (BPMN calls these pucks tokens.) This is not just a friendly picture — RxJS really works this way and calls the three wires notification channels (next, error, complete). If you can draw what has to happen asynchronously, you can almost certainly build it from a few boxes.\n\nThe model has one extension over BPMN: a puck can carry a whole other diagram — not wired in at design time like a BPMN call activity, but arriving as data, at runtime, on the wire. That is all a higher-order observable is, and the entire \"higher order\" branch of the map. And one correction: unlike BPMN, the error and complete wires are one-shot. Once a puck passes through either of them, the value wire is dead — which is why a completed Subject never emits again, and why `retry`\n\nand `repeat`\n\nexist at all.\n\nFinally, the model needs a fourth wire, and it runs backwards. `subscribe`\n\nat the end connects the boxes back to front; disconnection travels the same way, from the box that triggers it back up the chain. Two of his rules follow directly. Every `subscribe`\n\nbuilds a new instance of the whole diagram — two subscribers means two HTTP requests — unless a `share`\n\nbox plugs the second subscriber into the instance already running. And cleanup boxes like `takeUntil`\n\nbelong at the end of the pipe, so their disconnect wave covers the entire diagram (\"takeUntil last\", as the community rule goes).\n\nThe most important part of his two hours is not an operator. It is a rule:\n\nA stream must be designed so that it knows, by itself, when to end. A manual`unsubscribe`\n\nis a code smell.\n\nMost tutorials teach \"don't forget to unsubscribe.\" That is a habit, and habits get forgotten. His rule is a design requirement, and design requirements get checked in code review. A stream without a designed ending — `takeUntil`\n\n, `take(1)`\n\n, `first()`\n\n, a completing source, or `takeUntilDestroyed()`\n\nin Angular — simply does not pass review.\n\nAngular's new `resource()`\n\nand `httpResource()`\n\nAPIs (stable since Angular 22) enforce the same rule: a resource's lifecycle is bound to its context and cannot be leaked manually. His map enforces the rule through training. The new APIs enforce it through their design. Same rule, two enforcement mechanisms. Most of the argument between \"RxJS people\" and \"signals people\" is about where the rule should live, not about the rule.\n\nThe original map targeted RxJS 5. I updated it to current 7.x — deprecated operators are gone, and a new \"out of the stream\" branch covers `toSignal`\n\n, because in 2026 streams often end in a signal.\n\n**Try the map live:** [widiak.github.io/rxjs-cheat-sheet/rxjs-map-en.html](https://widiak.github.io/rxjs-cheat-sheet/rxjs-map-en.html) (full-text search included). All formats — posters, markdown, the Slovak original — in the repo: [github.com/widiak/rxjs-cheat-sheet](https://github.com/widiak/rxjs-cheat-sheet)\n\nTake it, translate it, rebuild it in your own words. The exact artifact matters less than the two decisions behind it: group by question, annotate by difference. And if your team's RxJS knowledge currently lives in one senior developer's head, put it in a markdown file in the repo this week.\n\nLibraries don't fail because their code is bad. They fail because nobody can teach them. RxJS documentation has spent a decade explaining precisely what each operator does, and almost nothing on how the operators differ and when a design is wrong. If you maintain a library, that second part is not optional community content. It is part of the product.\n\n*This post grew out of a conversation about Angular's resource API that turned into an argument about RxJS, which the developer won.*", "url": "https://wpnews.pro/news/a-one-page-map-teaches-rxjs-in-two-hours-the-official-docs-never-managed-that", "canonical_source": "https://dev.to/widiak/a-one-page-map-teaches-rxjs-in-two-hours-the-official-docs-never-managed-that-cem", "published_at": "2026-09-03 13:43:36+00:00", "updated_at": "2026-09-03 13:54:39.828949+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["RxJS", "Angular", "Anthropic", "Claude"], "alternates": {"html": "https://wpnews.pro/news/a-one-page-map-teaches-rxjs-in-two-hours-the-official-docs-never-managed-that", "markdown": "https://wpnews.pro/news/a-one-page-map-teaches-rxjs-in-two-hours-the-official-docs-never-managed-that.md", "text": "https://wpnews.pro/news/a-one-page-map-teaches-rxjs-in-two-hours-the-official-docs-never-managed-that.txt", "jsonld": "https://wpnews.pro/news/a-one-page-map-teaches-rxjs-in-two-hours-the-official-docs-never-managed-that.jsonld"}}