Trying to create an rxjs pipeline that will do the following:
Essentially I have an array of a dynamic number of API calls. Every time I need to make a new API call, I push it to the array.
Then, I transform the array into an array of RXJS switchmap operators. (The sequence of the calls doesn't matter, just that I need to make one call after the previous call finishes, and not at the same time).
Finally, I try to spread the array of rxjs operators inside a pipe:
const obsArray = [randomQuote(), getCatFacts(4), recipeSearch('oil')]
const OperatorWrap = obsArray.map((obs) => {
return rxops.switchMap((val) => { return obs })
})
const pipeline= of(1).pipe(...OperatorWrap);
But I get a strange error message:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…