In my angular 6 application, I want to filter before it switchMap to inner Observable as below:
Basically, What I want to do is if the store selector gives me pertaining data for a given string I will use the response in switchMap to fire the inner observable and will do a subscription.
The idea here is that if filtration succeeds do find and data for the filters response using 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)
})
The above code gives the error below:
Type 'detail' is missing the following properties from type 'Observable<detail[]>': _isScalar, source, operator, lift, and 10 more.ts(2345)
will combineLatest help here? or something I need to do with switchMap only.. ?