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);
Simply by piping zip
and map
:
numbersOverTime$ = zip(array$, inter$)
.pipe(
map(([item, i]) => item)
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With