From 3a77c2d5d6a3f75caf488f03ed045b01bd026147 Mon Sep 17 00:00:00 2001 From: sumitarora Date: Thu, 26 Oct 2017 22:52:59 -0400 Subject: [PATCH] docs: Adding documentation for concatAll operator. --- src/operator-docs/combination/concatAll.ts | 67 +++++++++++++++++++++- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/src/operator-docs/combination/concatAll.ts b/src/operator-docs/combination/concatAll.ts index 8d37f4e8..b7d1d543 100644 --- a/src/operator-docs/combination/concatAll.ts +++ b/src/operator-docs/combination/concatAll.ts @@ -1,6 +1,67 @@ -import { OperatorDoc } from '../operator.model'; +import { OperatorDoc } from "../operator.model"; export const concatAll: OperatorDoc = { - 'name': 'concatAll', - 'operatorType': 'combination' + name: "concatAll", + operatorType: "combination", + signature: "public concatAll(): Observable", + parameters: [], + marbleUrl: "http://reactivex.io/rxjs/img/concatAll.png", + shortDescription: { + description: + "Converts a higher-order Observable into a first-order Observable by concatenating the inner Observables in order.", + extras: [ + { + type: "Tip", + text: + "Flattens an Observable-of-Observables by putting one inner Observable after the other." + } + ] + }, + walkthrough: { + description: ` + Joins every Observable emitted by the source (a higher-order Observable), in a serial fashion. + It subscribes to each inner Observable only after the previous inner Observable has completed, + and merges all of their values into the returned observable. + `, + extras: [ + { + type: "Warning", + text: ` + If the source Observable emits Observables quickly and endlessly, and the inner Observables it emits generally + complete slower than the source emits, you can run into memory issues as the incoming Observables collect in an unbounded buffer. + ` + }, + { + type: "Tip", + text: `concatAll is equivalent to mergeAll with concurrency parameter set to 1.` + } + ] + }, + examples: [ + { + name: + "For each click event, tick every second from 0 to 3, with no concurrency", + code: ` + const clicks = Rx.Observable.fromEvent(document, 'click'); + const higherOrder = clicks.map(ev => Rx.Observable.interval(1000).take(4)); + const firstOrder = higherOrder.concatAll(); + firstOrder.subscribe(x => console.log(x)); + `, + externalLink: { + platform: "JSBin", + url: "http://jsbin.com/guhefeyahi/edit?js,console,output" + } + } + ], + relatedOperators: [ + "combineAll", + "concat", + "concatMap", + "concatMapTo", + "exhaust", + "mergeAll", + "switch", + "zipAll" + ], + additionalResources: [] };