Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit 29af945

Browse files
authored
Merge pull request #134 from sumitarora/feat-concat-all
docs: Adding documentation for concatAll operator.
2 parents 86bdde6 + 3a77c2d commit 29af945

File tree

1 file changed

+64
-3
lines changed

1 file changed

+64
-3
lines changed
Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,67 @@
1-
import { OperatorDoc } from '../operator.model';
1+
import { OperatorDoc } from "../operator.model";
22

33
export const concatAll: OperatorDoc = {
4-
'name': 'concatAll',
5-
'operatorType': 'combination'
4+
name: "concatAll",
5+
operatorType: "combination",
6+
signature: "public concatAll(): Observable",
7+
parameters: [],
8+
marbleUrl: "http://reactivex.io/rxjs/img/concatAll.png",
9+
shortDescription: {
10+
description:
11+
"Converts a higher-order Observable into a first-order Observable by concatenating the inner Observables in order.",
12+
extras: [
13+
{
14+
type: "Tip",
15+
text:
16+
"Flattens an Observable-of-Observables by putting one inner Observable after the other."
17+
}
18+
]
19+
},
20+
walkthrough: {
21+
description: `
22+
Joins every Observable emitted by the source (a higher-order Observable), in a serial fashion.
23+
It subscribes to each inner Observable only after the previous inner Observable has completed,
24+
and merges all of their values into the returned observable.
25+
`,
26+
extras: [
27+
{
28+
type: "Warning",
29+
text: `
30+
If the source Observable emits Observables quickly and endlessly, and the inner Observables it emits generally
31+
complete slower than the source emits, you can run into memory issues as the incoming Observables collect in an unbounded buffer.
32+
`
33+
},
34+
{
35+
type: "Tip",
36+
text: `concatAll is equivalent to mergeAll with concurrency parameter set to 1.`
37+
}
38+
]
39+
},
40+
examples: [
41+
{
42+
name:
43+
"For each click event, tick every second from 0 to 3, with no concurrency",
44+
code: `
45+
const clicks = Rx.Observable.fromEvent(document, 'click');
46+
const higherOrder = clicks.map(ev => Rx.Observable.interval(1000).take(4));
47+
const firstOrder = higherOrder.concatAll();
48+
firstOrder.subscribe(x => console.log(x));
49+
`,
50+
externalLink: {
51+
platform: "JSBin",
52+
url: "http://jsbin.com/guhefeyahi/edit?js,console,output"
53+
}
54+
}
55+
],
56+
relatedOperators: [
57+
"combineAll",
58+
"concat",
59+
"concatMap",
60+
"concatMapTo",
61+
"exhaust",
62+
"mergeAll",
63+
"switch",
64+
"zipAll"
65+
],
66+
additionalResources: []
667
};

0 commit comments

Comments
 (0)