小编s1e*_*per的帖子

RXJS - 多个连续的 http 请求

source<http>
  .pipe(
    switchMap(d => this.http.get(d))
      .pipe(
        switchMap(j => this.http.get(j))
      )
  )
  .subscribe()
Run Code Online (Sandbox Code Playgroud)

您好,我需要连续发出 3 个 http 请求,其中每个调用都包含下一次调用的数据。嵌套切换映射是这种情况下的最佳实践吗?

rxjs angular rxjs6

2
推荐指数
1
解决办法
665
查看次数

标签 统计

angular ×1

rxjs ×1

rxjs6 ×1