0
我一直在试图解决这个问题一段时间了,我猜这是一个相当普遍的问题,但我想要做的是增加来自观察到,并增强与观察或promiselike 发生所以我想类似如下:在可观察的数组中增加单独的值 - RxJS
function augment(person: Person): Observable<PersonWithAddress> {
// does ajax call or something
}
const items$: Observable<Person[]>;
items$
.do(x => {}) // x would be of type Person[]
.flatFlatMap(person => { // person would be of type Person
return augment(person); // this would return an Observable<PersonWithAddress>
})
.subscribe(peopleWithAddresses => { // peopleWithAddresses would be of type PersonWithAddress[]
})
是否有某种运营商对于这一点,我得到我可以增加或映射从可观察到的发射的单个项目来自flatMap可观察对象的其他东西,但是有一些像flatFlatMap等等。
OMG,非常感谢,我现在一直在为此苦苦挣扎。有这么多的经营者 – YentheO
是的,有几个学习。您可能没有看到它,但RxJS网页底部有一个向导,您可能会发现它很有用:http://reactivex.io/rxjs/ – cartant