angular-extensions / lint-rules

tslint rules useful for angular projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pipe(takeUntil()) is not recognized

GlauberF opened this issue · comments

running ng lint, shows the following error or lack of takeUntil

ERROR: /var/www/html/pwa-vimbo-new/src/@vimbo/directives/vimbo-perfect-scrollbar/vimbo-perfect-scrollbar.directive.ts:176:18 - subscribe within a component must be preceded by takeUntil

Captura de Tela_selecionar área_20200312083958

but you can see that in the line where the error is being accused, there is a pipe with takeUntil
Captura de Tela_selecionar área_20200312083942

Enviroment

Angular CLI: 8.3.23
Node: 10.15.3
OS: linux x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                                    Version
--------------------------------------------------------------------
@angular-devkit/architect                  0.803.23
@angular-devkit/build-angular              0.803.23
@angular-devkit/build-optimizer            0.803.20
@angular-devkit/build-webpack              0.803.23
@angular-devkit/core                       8.3.23
@angular-devkit/schematics                 8.3.23
@angular/cdk                               8.2.3
@angular/cli                               8.3.23
@angular/flex-layout                       8.0.0-beta.27
@angular/material                          8.2.3
@angular/material-moment-adapter           8.2.3
@ngtools/webpack                           8.3.23
@nguniversal/express-engine                8.2.6
@nguniversal/module-map-ngfactory-loader   8.2.6
@schematics/angular                        8.3.23
@schematics/update                         0.803.23
rxjs                                       6.5.4
typescript                                 3.5.3
webpack                                    4.39.2

the takeUntil operator must be the last operator in the .pipe() call

@macjohnny
right, sorry for my beginner question,
won't this affect the result for the filter(...)?

Why the idea is there, do takeUntil and then start the whole process again, starting with the filter.

no worries, maybe the error message should be improved.

the takeUntil does not affect the result of the observable.
the takeUntil simply unsubscribes the subscription created with .subscribe()

Thanks :)