【发布时间】:2020-11-03 06:37:44
【问题描述】:
我如何解开 observable (this.fireStore.getExtras(v["extrasId"]))
在以下地图内?
this.authService
.getUser()
.pipe(
flatMap((val) => this.fireStore.getItems(val.uid)),
map((val) =>
val.map((v) => ({ // this is regular array.map
...v,
extras: {
...v["extras"],
url: (this.fireStore.getExtras(v["extrasId"])).url // this is an observable. I want it to be unwrapped inside here itself,
},
}))
)
)
这是要解包的内部 observable (this.fireStore.getExtras(v["extrasId"]))。
我试过flatMap,但它正在返回函数本身..., url: flatmap() => ...
【问题讨论】:
标签: javascript rxjs