Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 6 zip is deprecated: resultSelector is no longer supported, pipe to map instead

In Angular 6 zip is deprecated:   tslint gives me the following message:

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

  How can I upgrade this following code:    

import {interval, from, zip} from 'rxjs';
let testArray = [1, 2, 3, 4, 5];
array$ = from(testArray);
inter$ = interval(1000);
numbersOverTime$ = zip(array$, inter$, (item, i) => item);
like image 258
apollowebdesigns Avatar asked Sep 19 '18 09:09

apollowebdesigns


1 Answers

Simply by piping zip and map:

numbersOverTime$ = zip(array$, inter$)
  .pipe(
    map(([item, i]) => item)
  );
like image 143
martin Avatar answered Nov 09 '22 06:11

martin