I need concat an array of observables and then subscribe to them
there's the function
let arrayObservable: Array<Observable<any>> = new Array<Observable<any>>();
products
.forEach(product => {
arrayObservable.push(this.service.delete(product));
});
Observable.concat(arrayObservable)
.subscribe(response => {
console.log(response)
})
concat
and merge
are static functions in rxjs
. They are not on Observable
.
Example:
import { concat, of} from "rxjs";
const n1 = of(1,2,3);
const n2 = of(4,5,6);
const cc = concat(n1, n2);
cc.subscribe(d=> console.log(d));
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments