timer

·2022년 10월 26일
0

RxJS

목록 보기
4/9

주어진시간후에 방출을 시작하는 옵저버블객체를 반환하는 함수다.

delay는 오퍼레이터

timer(1000).subscribe(console.log);

1초후에 0을 방출하고 완료한다.

timer(1000).pipe(
  mergeMap( ()=>scheduled([1,2,3],asyncScheduler) )
).subscribe({
  next:val=>console.log(val),
  complete:()=>console.log('complete')
});

1초후에 새로운 옵저버블객체가 방출시작한다.

0개의 댓글