File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ # Avoid nested ` pipe ` calls (` no-nested-pipe ` )
2+
3+ This rule effects failures if ` pipe ` is called within a ` pipe ` handler.
4+
5+ ## Rule details
6+
7+ Examples of ** incorrect** code for this rule:
8+
9+ ``` ts
10+ import { of , timer } from " rxjs" ;
11+
12+ of (" searchText1" , " searchText2" ).pipe (switchMap ((searchText ) => {
13+ return this .callSearchAPI (searchText ).pipe (map (response => {
14+ ......
15+ ......
16+ // considering more lines here
17+ })
18+ })
19+ ` ` `
20+
21+ Examples of **correct** code for this rule:
22+
23+ ` ` ` ts
24+ import { of , timer } from " rxjs" ;
25+ import { mapTo , mergeMap } from " rxjs/operators" ;
26+
27+ of (" searchText1" , " searchText2" ).pipe (switchMap ((searchText ) => this .getDisplayResponse (searchText )))
28+
29+ function getDisplayResponse (){
30+ this .callSearchAPI (searchText ).pipe (map (response => {
31+ ......
32+ ......
33+ // considering more lines here
34+ }
35+
36+ ` ` `
37+
38+ ## Options
39+
40+ This rule has no options.
You can’t perform that action at this time.
0 commit comments