【发布时间】:2020-12-08 23:34:52
【问题描述】:
理论上,我知道什么是 mergeMap 以及它是如何工作的,但是当我尝试理解使用 实用的方法我很困惑,这是我到目前为止所做的
const input1$= of("value 1","value 2","value 3");
const input2$= of(1,2,3,4);
const obs=input1$.pipe(
mergeMap(data1=>{
return input2$
.pipe(map(ch=>{ch+' '+data1}))})
)
不幸的是,当我尝试合并它们时,我变得不确定,如果你能帮助我了解它是如何工作的,我们将不胜感激。
【问题讨论】:
-
您的管道中没有退货
return ch+' '+data1 -
你能告诉我怎么做吗?
标签: angular rxjs rxjs5 rxjs6 rxjs-pipeable-operators