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

Commit 954eae8

Browse files
Merge pull request #250 from JWO719/add-docs-for-let
docs(operators): add let operator
2 parents 4aae5d3 + 9f34fc2 commit 954eae8

File tree

1 file changed

+59
-2
lines changed
  • src/operator-docs/utility

1 file changed

+59
-2
lines changed

src/operator-docs/utility/let.ts

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

33
export const letOperator: OperatorDoc = {
4-
'name': 'let',
5-
'operatorType': 'utility'
4+
name: 'let',
5+
operatorType: 'utility',
6+
signature: 'public let(fun: function): Observable,',
7+
parameters: [
8+
{
9+
name: 'fun',
10+
type: 'function',
11+
attribute: '',
12+
description: `Selector function which can use the source sequence
13+
as many times as needed, without sharing subscriptions to the source sequence.`
14+
}
15+
],
16+
shortDescription: {
17+
description: `Returns an observable sequence that is the result of invoking the selector on the source sequence,
18+
without sharing subscriptions. This operator allows for a fluent style of writing queries that use the same
19+
sequence multiple times. There is an alias of letBind for browsers older than IE 9.`
20+
},
21+
additionalResources: [
22+
{
23+
url: 'https://www.learnrxjs.io/operators/utility/let.html',
24+
description: 'several examples of using the let operator',
25+
author: 'btroncone'
26+
}
27+
],
28+
examples: [
29+
{
30+
name: 'calls concat as part of a pipeline',
31+
code: `
32+
import { range } from 'rxjs/observable/range';
33+
34+
const obs = range(1, 3);
35+
36+
const source = obs.let((o) => o.concat(o));
37+
38+
const subscription = source.subscribe(
39+
(x) => {
40+
console.log('Next: ' + x);
41+
},
42+
(err) => {
43+
console.log('Error: ' + err);
44+
},
45+
() => {
46+
console.log('Completed');
47+
});
48+
49+
// => Next: 1
50+
// => Next: 2
51+
// => Next: 3
52+
// => Next: 1
53+
// => Next: 2
54+
// => Next: 3
55+
// => Completed
56+
`,
57+
externalLink: {
58+
platform: 'JSBin',
59+
url: 'http://jsbin.com/giwanupiqu/embed?html,js,console'
60+
}
61+
}
62+
]
663
};

0 commit comments

Comments
 (0)