please see my code below
import { Observable, interval } from 'rxjs';
import { map, take, mergeMap, concatMap, switchMap, exhaustMap } from 'rxjs/operators';
const frameworks = ['Backbone', 'Angular', 'React', 'Vue'];
const getRecruits = agency => new Observable(observer => {
console.log('agency', agency);
interval(1000).pipe(
take(5)
).subscribe(val => observer.next(`${agency} Developer ${val}`));
});
// concatMap
interval(3000).pipe(
take(4),
map(val => frameworks[val]),
concatMap(agency => getRecruits(agency))
).subscribe(val => console.log(val));
and this is my output:
I expected after Backbone finished, it would have continued with Angular, React and then Vue. But the execution stopped after Backbone
any explanations?