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

Commit 7c21b07

Browse files
Merge branch 'master' into iss-124
2 parents 89037d7 + 5cce3ae commit 7c21b07

File tree

1 file changed

+54
-2
lines changed
  • src/operator-docs/transformation

1 file changed

+54
-2
lines changed
Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,58 @@
11
import { OperatorDoc } from '../operator.model';
22

33
export const pluck: OperatorDoc = {
4-
'name': 'pluck',
5-
'operatorType': 'transformation'
4+
name: 'pluck',
5+
operatorType: 'transformation',
6+
signature: 'public pluck(properties: ...string): Observable',
7+
marbleUrl: 'http://reactivex.io/rxjs/img/pluck.png',
8+
parameters: [
9+
{
10+
name: 'properties',
11+
type: '...string',
12+
attribute: '',
13+
description: `
14+
The nested properties to 'pluck' from each source value (an object).
15+
`
16+
}
17+
],
18+
shortDescription: {
19+
description:
20+
'Maps each source value (an object) to its specified nested property.',
21+
extras: [
22+
{
23+
type: 'Tip',
24+
text: `
25+
Like <a href="#/operators/map" class="markdown-code">map</a>, but meant
26+
only for picking one of the nested properties of every emitted object.
27+
`
28+
}
29+
]
30+
},
31+
walkthrough: {
32+
description: `
33+
<p>
34+
Given a list of strings describing a path to an object property, retrieves
35+
the value of a specified nested property from all values in the source Observable.
36+
If a property can't be resolved, it will return <span class="markdown-code">undefined</span>
37+
for that value.
38+
</p>
39+
`
40+
},
41+
examples: [
42+
{
43+
name:
44+
'Map every every click to the tagName of the clicked target element',
45+
code: `
46+
const clicks = Rx.Observable.fromEvent(document, 'click');
47+
const tagNames = clicks.pluck('target', 'tagName');
48+
tagNames.subscribe(x => console.log(x));
49+
`,
50+
externalLink: {
51+
platform: 'JSBin',
52+
url: 'http://jsbin.com/vucuca/embed?js,console,output'
53+
}
54+
}
55+
],
56+
relatedOperators: ['map'],
57+
additionalResources: []
658
};

0 commit comments

Comments
 (0)