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

Commit 4ce8d6f

Browse files
Merge pull request #179 from btroncone/rx-marbles-fix
Standardize operator docs
2 parents e7ad9ca + c0bc8a4 commit 4ce8d6f

File tree

12 files changed

+119
-113
lines changed

12 files changed

+119
-113
lines changed

src/app/app-routing.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export const routes: Routes = [
1818
@NgModule({
1919
imports: [
2020
RouterModule.forRoot(routes, {
21-
preloadingStrategy: PreloadAllModules
21+
preloadingStrategy: PreloadAllModules,
22+
useHash: true
2223
})
2324
],
2425
exports: [RouterModule]
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<div
2-
*ngIf="!useInteractiveMarbles"
3-
class="marble-wrapper mat-elevation-z2">
4-
<img class="marble-diagram" [src]="url" *ngIf="url"/>
1+
<div class="marble-wrapper mat-elevation-z2">
2+
<img class="marble-diagram"
3+
[src]="url"
4+
*ngIf="url" />
55
</div>
6-
<rx-marbles
7-
*ngIf="useInteractiveMarbles"
8-
[attr.key]="operatorName">
9-
</rx-marbles>
6+
<!-- <rx-marbles *ngIf="useInteractiveMarbles"
7+
[attr.key]="operatorName">
8+
</rx-marbles> -->

src/operator-docs/combination/combineAll.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const combineAll: OperatorDoc = {
1616
marbleUrl: 'http://reactivex.io/rxjs/img/combineAll.png',
1717
shortDescription: {
1818
description: `
19-
Flattens an Observable-of-Observables by applying <a href="/operators/combineLatest" class="markdown-code">combineLatest</a>
19+
Flattens an Observable-of-Observables by applying <a href="/#/operators/combineLatest" class="markdown-code">combineLatest</a>
2020
when the Observable-of-Observables completes.`,
2121
extras: []
2222
},
@@ -25,7 +25,7 @@ export const combineAll: OperatorDoc = {
2525
<p>
2626
Takes an Observable of Observables, and collects all Observables from it.
2727
Once the outer Observable completes, it subscribes to all collected
28-
Observables and combines their values using the <a href="/operators/combineLatest" class="markdown-code">combineLatest</a>
28+
Observables and combines their values using the <a href="/#/operators/combineLatest" class="markdown-code">combineLatest</a>
2929
strategy, such that:
3030
</p>
3131
<ul>

src/operator-docs/combination/combineLatest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const combineLatest: OperatorDoc = {
3333
type: 'Tip',
3434
text: `
3535
Note: combineLatest will only start to emit when all sources have emitted at least once. By adding a default
36-
start value to the sources with <a href="/operators#startWith">.startWith</a>, it will activate right away.
36+
start value to the sources with <a href="#/operators/startWith" class="markdown-code">startWith</a>, it will activate right away.
3737
`
3838
}
3939
]
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { OperatorDoc } from "../operator.model";
1+
import { OperatorDoc } from '../operator.model';
22

33
export const concatAll: OperatorDoc = {
4-
name: "concatAll",
5-
operatorType: "combination",
6-
signature: "public concatAll(): Observable",
4+
name: 'concatAll',
5+
operatorType: 'combination',
6+
signature: 'public concatAll(): Observable',
77
parameters: [],
8-
marbleUrl: "http://reactivex.io/rxjs/img/concatAll.png",
8+
marbleUrl: 'http://reactivex.io/rxjs/img/concatAll.png',
99
shortDescription: {
1010
description:
11-
"Converts a higher-order Observable into a first-order Observable by concatenating the inner Observables in order.",
11+
'Converts a higher-order Observable into a first-order Observable by concatenating the inner Observables in order.',
1212
extras: [
1313
{
14-
type: "Tip",
14+
type: 'Tip',
1515
text:
16-
"Flattens an Observable-of-Observables by putting one inner Observable after the other."
16+
'Flattens an Observable-of-Observables by putting one inner Observable after the other.'
1717
}
1818
]
1919
},
@@ -25,43 +25,43 @@ export const concatAll: OperatorDoc = {
2525
`,
2626
extras: [
2727
{
28-
type: "Warning",
28+
type: 'Warning',
2929
text: `
3030
If the source Observable emits Observables quickly and endlessly, and the inner Observables it emits generally
3131
complete slower than the source emits, you can run into memory issues as the incoming Observables collect in an unbounded buffer.
3232
`
3333
},
3434
{
35-
type: "Tip",
35+
type: 'Tip',
3636
text: `concatAll is equivalent to mergeAll with concurrency parameter set to 1.`
3737
}
3838
]
3939
},
4040
examples: [
4141
{
4242
name:
43-
"For each click event, tick every second from 0 to 3, with no concurrency",
43+
'For each click event, tick every second from 0 to 3, with no concurrency',
4444
code: `
4545
const clicks = Rx.Observable.fromEvent(document, 'click');
4646
const higherOrder = clicks.map(ev => Rx.Observable.interval(1000).take(4));
4747
const firstOrder = higherOrder.concatAll();
4848
firstOrder.subscribe(x => console.log(x));
4949
`,
5050
externalLink: {
51-
platform: "JSBin",
52-
url: "http://jsbin.com/guhefeyahi/edit?js,console,output"
51+
platform: 'JSBin',
52+
url: 'http://jsbin.com/guhefeyahi/embed?js,console,output'
5353
}
5454
}
5555
],
5656
relatedOperators: [
57-
"combineAll",
58-
"concat",
59-
"concatMap",
60-
"concatMapTo",
61-
"exhaust",
62-
"mergeAll",
63-
"switch",
64-
"zipAll"
57+
'combineAll',
58+
'concat',
59+
'concatMap',
60+
'concatMapTo',
61+
'exhaust',
62+
'mergeAll',
63+
'switch',
64+
'zipAll'
6565
],
6666
additionalResources: []
6767
};
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
import { OperatorDoc } from "../operator.model";
1+
import { OperatorDoc } from '../operator.model';
22

33
export const merge: OperatorDoc = {
4-
name: "merge",
5-
operatorType: "combination",
4+
name: 'merge',
5+
operatorType: 'combination',
66
signature:
7-
"public merge(other: ObservableInput, concurrent: number, scheduler: Scheduler): Observable",
7+
'public merge(other: ObservableInput, concurrent: number, scheduler: Scheduler): Observable',
88
parameters: [
99
{
10-
name: "other",
11-
type: "ObservableInput",
12-
attribute: "",
10+
name: 'other',
11+
type: 'ObservableInput',
12+
attribute: '',
1313
description: `An input Observable to merge with the source Observable. More than one input
1414
Observables may be given as argument.`
1515
},
1616
{
17-
name: "concurrent",
18-
type: "number",
19-
attribute: "optional, default: Number.POSITIVE_INFINITY",
17+
name: 'concurrent',
18+
type: 'number',
19+
attribute: 'optional, default: Number.POSITIVE_INFINITY',
2020
description: `Maximum number of input Observables being subscribed to concurrently.`
2121
},
2222
{
23-
name: "scheduler",
24-
type: "Scheduler",
25-
attribute: "optional, default: null",
23+
name: 'scheduler',
24+
type: 'Scheduler',
25+
attribute: 'optional, default: null',
2626
description: `The IScheduler to use for managing concurrency of input Observables.`
2727
}
2828
],
29-
marbleUrl: "http://reactivex.io/rxjs/img/merge.png",
29+
marbleUrl: 'http://reactivex.io/rxjs/img/merge.png',
3030
shortDescription: {
3131
description: `Creates an output Observable which concurrently emits all values
3232
from every given input Observable. <span class="informal">Flattens multiple Observables
3333
together by blending their values into one Observable.</span>`
3434
},
3535
walkthrough: {
3636
description: `
37-
<p><code>Merge</code> subscribes to each given input Observable (either the source or an
37+
<p><span class="markdown-code">Merge</span> subscribes to each given input Observable (either the source or an
3838
Observable given as argument), and simply forwards (without doing any
3939
transformation) all the values from all the input Observables to the output
4040
Observable. The output Observable only completes once all input Observables
@@ -44,20 +44,20 @@ export const merge: OperatorDoc = {
4444
},
4545
examples: [
4646
{
47-
name: "Merge together two Observables: 1s interval and clicks",
47+
name: 'Merge together two Observables: 1s interval and clicks',
4848
code: `
4949
const clicks = Rx.Observable.fromEvent(document, 'click');
5050
const timer = Rx.Observable.interval(1000);
5151
const clicksOrTimer = clicks.merge(timer);
5252
clicksOrTimer.subscribe(x => console.log(x));
5353
`,
5454
externalLink: {
55-
platform: "JSBin",
56-
url: "http://jsbin.com/wihafapiva/1/edit?js,output"
55+
platform: 'JSBin',
56+
url: 'http://jsbin.com/wihafapiva/1/embed?js,output'
5757
}
5858
},
5959
{
60-
name: "Merge together 3 Observables, but only 2 run concurrently",
60+
name: 'Merge together 3 Observables, but only 2 run concurrently',
6161
code: `
6262
const timer1 = Rx.Observable.interval(1000).take(10);
6363
const timer2 = Rx.Observable.interval(2000).take(6);
@@ -67,10 +67,10 @@ export const merge: OperatorDoc = {
6767
merged.subscribe(x => console.log(x));
6868
`,
6969
externalLink: {
70-
platform: "JSBin",
71-
url: "http://jsbin.com/midosuqaga/1/edit?js,output"
70+
platform: 'JSBin',
71+
url: 'http://jsbin.com/midosuqaga/1/embed?js,output'
7272
}
7373
}
7474
],
75-
relatedOperators: ["mergeAll", "mergeMap", "mergeMapTo", "mergeScan"]
75+
relatedOperators: ['mergeAll', 'mergeMap', 'mergeMapTo', 'mergeScan']
7676
};
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import { OperatorDoc } from "../operator.model";
1+
import { OperatorDoc } from '../operator.model';
22

33
export const mergeAll: OperatorDoc = {
4-
name: "mergeAll",
5-
operatorType: "combination",
6-
signature: "public mergeAll(concurrent: number): Observable",
4+
name: 'mergeAll',
5+
operatorType: 'combination',
6+
signature: 'public mergeAll(concurrent: number): Observable',
77
parameters: [
88
{
9-
name: "concurrent",
10-
type: "number",
11-
attribute: "optional, default: Number.POSITIVE_INFINITY",
9+
name: 'concurrent',
10+
type: 'number',
11+
attribute: 'optional, default: Number.POSITIVE_INFINITY',
1212
description: `Maximum number of input Observables being subscribed to concurrently.`
1313
}
1414
],
15-
marbleUrl: "http://reactivex.io/rxjs/img/mergeAll.png",
15+
marbleUrl: 'http://reactivex.io/rxjs/img/mergeAll.png',
1616
shortDescription: {
1717
description: `Converts a higher-order Observable into a first-order Observable which concurrently
1818
delivers all values that are emitted on the inner Observables`,
1919
extras: [
2020
{
21-
type: "Tip",
22-
text: "Flattens an Observable-of-Observables."
21+
type: 'Tip',
22+
text: 'Flattens an Observable-of-Observables.'
2323
}
2424
]
2525
},
2626
walkthrough: {
2727
description: `
28-
<p><code>MergeAll</code> subscribes to an Observable that emits Observables,
28+
<p><span class="markdown-code">MergeAll</span> subscribes to an Observable that emits Observables,
2929
also known as a higher-order Observable. Each time it observes one of these emitted
3030
inner Observables, it subscribes to that and delivers all the values from the inner
3131
Observable on the output Observable. The output Observable only completes once all inner
@@ -36,42 +36,42 @@ export const mergeAll: OperatorDoc = {
3636
examples: [
3737
{
3838
name:
39-
"Spawn a new interval Observable for each click event, and blend their outputs as one Observable",
39+
'Spawn a new interval Observable for each click event, and blend their outputs as one Observable',
4040
code: `
4141
const clicks = Rx.Observable.fromEvent(document, 'click');
4242
const higherOrder = clicks.map((ev) => Rx.Observable.interval(1000));
4343
const firstOrder = higherOrder.mergeAll();
4444
firstOrder.subscribe(x => console.log(x));
4545
`,
4646
externalLink: {
47-
platform: "JSBin",
48-
url: "http://jsbin.com/lebidefocu/1/edit?js,output"
47+
platform: 'JSBin',
48+
url: 'http://jsbin.com/lebidefocu/1/embed?js,output'
4949
}
5050
},
5151
{
5252
name:
53-
"Count from 0 to 9 every second for each click, but only allow 2 concurrent timers",
53+
'Count from 0 to 9 every second for each click, but only allow 2 concurrent timers',
5454
code: `
5555
const clicks = Rx.Observable.fromEvent(document, 'click');
5656
const higherOrder = clicks.map((ev) => Rx.Observable.interval(1000).take(10));
5757
const firstOrder = higherOrder.mergeAll(2);
5858
firstOrder.subscribe(x => console.log(x));
5959
`,
6060
externalLink: {
61-
platform: "JSBin",
62-
url: "http://jsbin.com/kokezoribu/edit?js,output"
61+
platform: 'JSBin',
62+
url: 'http://jsbin.com/kokezoribu/embed?js,output'
6363
}
6464
}
6565
],
6666
relatedOperators: [
67-
"combineAll",
68-
"concatAll",
69-
"exhaust",
70-
"merge",
71-
"mergeMap",
72-
"mergeMapTo",
73-
"mergeScan",
74-
"switch",
75-
"zipAll"
67+
'combineAll',
68+
'concatAll',
69+
'exhaust',
70+
'merge',
71+
'mergeMap',
72+
'mergeMapTo',
73+
'mergeScan',
74+
'switch',
75+
'zipAll'
7676
]
7777
};

src/operator-docs/creation/empty.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { OperatorDoc } from '../operator.model';
33
export const empty: OperatorDoc = {
44
name: 'empty',
55
operatorType: 'creation',
6-
signature: 'public empty<T>(scheduler?: IScheduler): Observable<T>',
6+
signature: 'public empty(scheduler?: IScheduler): Observable',
77
parameters: [
88
{
99
name: 'scheduler',
@@ -34,7 +34,7 @@ export const empty: OperatorDoc = {
3434
});`,
3535
externalLink: {
3636
platform: 'JSBin',
37-
url: 'http://jsbin.com/hojacunecu/1/edit?js,console,output'
37+
url: 'http://jsbin.com/hojacunecu/1/embed?js,console,output'
3838
}
3939
},
4040
{
@@ -46,7 +46,7 @@ export const empty: OperatorDoc = {
4646
});`,
4747
externalLink: {
4848
platform: 'JSBin',
49-
url: 'http://jsbin.com/tubonoradi/1/edit?js,console,output'
49+
url: 'http://jsbin.com/tubonoradi/1/embed?js,console,output'
5050
}
5151
},
5252
{
@@ -62,7 +62,7 @@ export const empty: OperatorDoc = {
6262
});`,
6363
externalLink: {
6464
platform: 'JSBin',
65-
url: 'http://jsbin.com/qazabojiri/edit?js,console,output'
65+
url: 'http://jsbin.com/qazabojiri/embed?js,console,output'
6666
}
6767
}
6868
],

0 commit comments

Comments
 (0)