在我的ANGLE 6应用程序中,我希望在它之前过滤switchMap
以获得内部可观察性,如下所示:
基本上,我想要做的是,如果store Select 器为我提供了给定字符串的相关数据,我将使用switchMap
中的响应来激发内部可观察对象,并进行订阅.
这里的 idea 是,如果过滤成功,则使用switchMap
查找过滤器响应的数据
this._store.pipe(select(getDetails)).pipe(map((details: detail[]) => {
return of(details.filter(({ tagName }) => tagName ===this.videoTagName))})
switchMap((data:detail)=>this._store.pipe(select(getVideosByID(data.contentIds[0]))))).subscribe(data=>{
console.log("Data",data)
})
上面的代码给出了以下错误:
Type 'detail' is missing the following properties from type 'Observable<detail[]>': _isScalar, source, operator, lift, and 10 more.ts(2345)
combineLatest
个人在这里能帮上忙吗?或者一些我只需要做switchMap
的事..?