tap

·2023년 1월 14일
0

RxJS

목록 보기
7/9
scheduled([1,2,3],asyncScheduler).pipe(
  tap({
    next:data=>console.log(data),
    error:(error) => this.logError(filename, error)
  })
).subscribe();

tap오퍼레이터에서도 구독처리와 같이 할 수 있다.

scheduled([1,2,3],asyncScheduler).pipe(
  tap({
    next:data=>console.log(data)
  })
)

템플릿에서 pipe로 구독해야하는 상황이라면 tap을 사용해서 필요한 동작을 수행할 수 있다.

0개의 댓글