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

Commit db6877e

Browse files
Wortmann, Jan-NiklasWortmann, Jan-Niklas
authored andcommitted
docs(operators): add let operator
1 parent 5edd48f commit db6877e

File tree

1 file changed

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

1 file changed

+57
-2
lines changed

src/operator-docs/utility/let.ts

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,61 @@
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+
const obs = Rx.Observable.range(1, 3);
33+
34+
const source = obs.let((o) => o.concat(o));
35+
36+
const subscription = source.subscribe(
37+
(x) => {
38+
console.log('Next: ' + x);
39+
},
40+
(err) => {
41+
console.log('Error: ' + err);
42+
},
43+
() => {
44+
console.log('Completed');
45+
});
46+
47+
// => Next: 1
48+
// => Next: 2
49+
// => Next: 3
50+
// => Next: 1
51+
// => Next: 2
52+
// => Next: 3
53+
// => Completed
54+
`,
55+
externalLink: {
56+
platform: 'JSBin',
57+
url: 'http://jsbin.com/giwanupiqu/embed?html,js,console'
58+
}
59+
}
60+
]
661
};

0 commit comments

Comments
 (0)