In the following code snippet I subscribe to a portfolio and iterate through an array. For each member of the array I create another subscription to listen to its quotes.
this.portfolio$
.subscribe(portfolio) => {
portfolio.watchlist.all.forEach((a) => {
this.store
.select((s) => s.quotes.quotes[a._id])
.subscribe((q) => {
console.warn('subscription')
}
}
})
})
Is there any RxJS operator which allows me to get rid of the outer subscription? In the end I only want to have as many subscriptions as I have quotes in the array.