Deprecated methods in rxjs v6

xavier

I try to use combineLatest:

import { combineLatest } from 'rxjs/Observable';

but I get the warning

combineLatest is deprecated: Deprecated in favor of static combineLatest. 

If I follow the solution provided in the RxJS v5.x to v6 Update Guide as it is stated here and I write

import { combineLatest } from 'rxjs';

then I get the tslint message:

This import is blacklisted, import a submodule instead

which seems a bit a snake biting its own tail...

If I use

import { combineLatest } from 'rxjs/internal/observable/combineLatest';

then it works without warning messages, but as far as I know, it's not recommended to import internal packages (correct me if I'm wrong).

Disabling tslint messages doesn't seem acceptable to me.

Example:

this.Subscription = combineLatest([a,b])
    .pipe(
      map( (...) )
    ).subscribe( (...) );

Which is the appropriate solution? Thanks.

xavier

I already found the solution, based on @martin's comment: my original project was created using Angular 6. When I upgraded Angular 6 to Angular 7 I didn't take into account that tslint.jsonhad been updated. This file was simplified and it included the line

"extends": "tslint:recommended"

(See here for more details). In the recommended tslint file, the package rxjs had been excluded from the blacklist.

So, I had an old version of the file tslint.json, I updated it and now I don't have this problem anymore.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related