Javascript – Why Rxjs switchMap only outputting last value from an of() source observable?
Below is 2 snippets one with map, and second one with switchMap. The working of map is understandable: of('foo', 'bar') .pipe(map((val) => sanitizer(val))) .subscribe((val) => console.log('value:', val)); function sanitizer(val: string) { return val; } Output: value: foo value: bar Now…