This repository was archived by the owner on Oct 1, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +57
-2
lines changed
src/operator-docs/utility Expand file tree Collapse file tree 1 file changed +57
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { OperatorDoc } from '../operator.model' ;
2
2
3
3
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
+ ]
6
61
} ;
You can’t perform that action at this time.
0 commit comments