How to delay forkJoin

前端 未结 3 1886
情话喂你
情话喂你 2021-01-17 01:01

How would you delay .forkJoin() in rxjs?

Here is what I\'ve got but want to use delay() operator with that?

return forkJoin(
   this.cal         


        
3条回答
  •  -上瘾入骨i
    2021-01-17 01:40

    use the delay operator withe the pipe operator

    import { delay, take } from 'rxjs/operators';
    import { forkJoin } from 'rxjs/observable/forkJoin';
    import { of } from 'rxjs/observable/of';
    
    return forkJoin(
       of(call1()).pipe(delay(1000)),
       of(call2()).pipe(delay(2000)),
       of(call3()).pipe(delay(1000))
     );
    

提交回复
热议问题