|
1 | | -import { OperatorDoc } from '../operator.model'; |
| 1 | +import { OperatorDoc } from "../operator.model"; |
2 | 2 |
|
3 | 3 | 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: [] |
6 | 67 | }; |
0 commit comments