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

Commit f2b3ee8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into multipages
2 parents 8a2386f + 8e84e13 commit f2b3ee8

File tree

4 files changed

+365
-45
lines changed

4 files changed

+365
-45
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
# IDEs and editors
1212
/.idea
13+
*.iml
1314
.project
1415
.classpath
1516
.c9/
Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,42 @@
1-
import { OperatorDoc } from "../operator.model";
1+
import { OperatorDoc } from '../operator.model';
22

33
export const combineLatest: OperatorDoc = {
4-
name: "combineLatest",
5-
operatorType: "combination",
4+
name: 'combineLatest',
5+
operatorType: 'combination',
66
signature:
7-
"public combineLatest(observables: ...Observable, project: function): Observable",
7+
'public combineLatest(observables: ...Observable, project: function): Observable',
88
useInteractiveMarbles: true,
99
parameters: [
1010
{
11-
name: "other",
12-
type: "Observable",
13-
attribute: "",
11+
name: 'other',
12+
type: 'Observable',
13+
attribute: '',
1414
description:
15-
"An input Observable to combine with the source Observable. More than one input Observables may be given as argument."
15+
'An input Observable to combine with the source Observable. More than one input Observables may be given as argument.'
1616
},
1717
{
18-
name: "other",
19-
type: "function",
20-
attribute: "optional",
18+
name: 'other',
19+
type: 'function',
20+
attribute: 'optional',
2121
description:
22-
"An optional function to project the values from the combined latest values into a new value on the output Observable."
22+
'An optional function to project the values from the combined latest values into a new value on the output Observable.'
2323
}
2424
],
25-
marbleUrl: "http://reactivex.io/rxjs/img/combineLatest.png",
25+
marbleUrl: 'http://reactivex.io/rxjs/img/combineLatest.png',
2626
shortDescription: {
2727
description: `
2828
Combines multiple Observables to create an Observable whose values
2929
are calculated from the latest values of each of its input Observables.
3030
`,
31-
extras: []
31+
extras: [
32+
{
33+
type: 'Tip',
34+
text: `
35+
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.
37+
`
38+
}
39+
]
3240
},
3341
walkthrough: {
3442
description: `
@@ -46,7 +54,7 @@ export const combineLatest: OperatorDoc = {
4654
examples: [
4755
{
4856
name:
49-
"Dynamically calculate the Body-Mass Index from an Observable of weight and one for height",
57+
'Dynamically calculate the Body-Mass Index from an Observable of weight and one for height',
5058
code: `
5159
const weight = Rx.Observable.of(70, 72, 76, 79, 75);
5260
const height = Rx.Observable.of(1.76, 1.77, 1.78);
@@ -60,11 +68,11 @@ export const combineLatest: OperatorDoc = {
6068
bmi.subscribe(x => console.log('BMI is ' + x));
6169
`,
6270
externalLink: {
63-
platform: "JSBin",
64-
url: "http://jsbin.com/pivowunedu/1/embed?js,console"
71+
platform: 'JSBin',
72+
url: 'http://jsbin.com/pivowunedu/1/embed?js,console'
6573
}
6674
}
6775
],
68-
relatedOperators: ["combineAll", "merge", "withLatestFrom"],
76+
relatedOperators: ['combineAll', 'merge', 'withLatestFrom'],
6977
additionalResources: []
7078
};
Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,70 @@
11
import { OperatorDoc } from '../operator.model';
22

33
export const empty: OperatorDoc = {
4-
'name': 'empty',
5-
'operatorType': 'creation'
4+
name: 'empty',
5+
operatorType: 'creation',
6+
signature: 'public empty<T>(scheduler?: IScheduler): Observable<T>',
7+
parameters: [
8+
{
9+
name: 'scheduler',
10+
type: 'IScheduler',
11+
attribute: 'optional',
12+
description:
13+
'Allows scheduling the emission of the complete notification.'
14+
}
15+
],
16+
marbleUrl: 'http://reactivex.io/rxjs/img/empty.png',
17+
shortDescription: {
18+
description:
19+
'Creates an Observable that emits no items to the Observer' +
20+
' and immediately emits a complete notification.'
21+
},
22+
walkthrough: {
23+
description: `This static operator is useful for creating a simple
24+
Observable that only emits the complete notification. It can be used for
25+
composing with other Observables`
26+
},
27+
examples: [
28+
{
29+
name: 'Observable completes immediately',
30+
code: `const observable = Rx.Observable.empty();
31+
const subscription = observable.subscribe({
32+
next: () => console.log('next'), // does not log anything
33+
complete: () => console.log('complete'), // logs 'complete'
34+
});`,
35+
externalLink: {
36+
platform: 'JSBin',
37+
url: 'http://jsbin.com/hojacunecu/1/edit?js,console,output'
38+
}
39+
},
40+
{
41+
name: 'Observable emits initial value then completes',
42+
code: `const observable = Rx.Observable.empty().startWith('initial value');
43+
const subscription = observable.subscribe({
44+
next: (val) => console.log(\`next: \${val}\`), // logs 'next: initial value'
45+
complete: () => console.log('complete'), // logs 'complete'
46+
});`,
47+
externalLink: {
48+
platform: 'JSBin',
49+
url: 'http://jsbin.com/tubonoradi/1/edit?js,console,output'
50+
}
51+
},
52+
{
53+
name: `Map and flatten only odd numbers to the sequence 'ax', 'bx', 'cx'`,
54+
code: `const source = Rx.Observable.of(1, 2, 3, 4, 5, 6, 7, 8, 9);
55+
const result = source.mergeMap(
56+
x => x % 2 === 1 ? Rx.Observable.of(\`a\${x}\`, \`b\${x}\`, \`c\${x}\`) :
57+
Rx.Observable.empty()
58+
);
59+
const subscription = result.subscribe({
60+
next: (x) => console.log(x), // logs result values
61+
complete: () => console.log('complete'), // logs 'complete'
62+
});`,
63+
externalLink: {
64+
platform: 'JSBin',
65+
url: 'http://jsbin.com/qazabojiri/edit?js,console,output'
66+
}
67+
}
68+
],
69+
relatedOperators: ['create', 'of', 'throw']
670
};

0 commit comments

Comments
 (0)