Chaining promises with RxJS

前端 未结 3 2065
青春惊慌失措
青春惊慌失措 2020-12-15 09:15

I\'m new to RxJS and FRP in general. I had the idea of converting an existing promise chain in my ExpressJS application to be an observable for practice. I am aware that thi

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-15 09:44

    Observable.forkJoin works great here receiving array of other Observables.

    Rx.Observable.forkJoin([this.http.get('http://jsonplaceholder.typicode.com/posts'), this.http.get('http://jsonplaceholder.typicode.com/albums')]).subscribe((data) => {
          console.log(data);
        });
    

提交回复
热议问题