Angular 6 ng lint combineLatest is deprecated

combineLatest is deprecated: resultSelector no longer supported, pipe to map instead

The above warning is recommending to remove the resultSelector the last function you provided in combineLatest observable and provide it as part of map operator as follows

const a$ = combineLatest(
  this.aStore.select(b.getAuth),
  this.cStore.select(b.getUrl)
);

const result$ = a$.pipe(
  map(results => ({auth: results[0], url: results[1]}))
)

UPDATE:

If you see combineLatest is deprecated: Pass arguments in a single array instead then just add []:

const a$ = combineLatest([
  this.aStore.select(b.getAuth),
  this.cStore.select(b.getUrl)
]);
    
const result$ = a$.pipe(
  map(results => ({auth: results[0], url: results[1]}))
)

Leave a Comment

tech