How can I create an observable with a delay

后端 未结 5 1043
醉梦人生
醉梦人生 2020-12-02 13:48

Question

For testing purposes, I\'m creating Observable objects that replace the observable that would be returned by an actual http call with H

5条回答
  •  春和景丽
    2020-12-02 14:30

    It's little late to answer ... but just in case may be someone return to this question looking for an answer

    'delay' is property(function) of an Observable

    fakeObservable = Observable.create(obs => {
      obs.next([1, 2, 3]);
      obs.complete();
    }).delay(3000);
    

    This worked for me ...

提交回复
热议问题