IT이야기

각도 6 zip이 더 이상 사용되지 않음: resultSelector가 더 이상 지원되지 않음, 파이프에서 맵으로

cyworld 2022. 3. 24. 22:13
반응형

각도 6 zip이 더 이상 사용되지 않음: resultSelector가 더 이상 지원되지 않음, 파이프에서 맵으로

각도 6 zip은 사용되지 않음: tslint는 다음과 같은 메시지를 제공한다.

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

다음 코드를 업그레이드하는 방법:

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);

간단히 파이프로zip그리고map:

numbersOverTime$ = zip(array$, inter$)
  .pipe(
    map(([item, i]) => item)
  );

참조URL: https://stackoverflow.com/questions/52402769/angular-6-zip-is-deprecated-resultselector-is-no-longer-supported-pipe-to-map

반응형