Z Przykład RXJS

import { of, from } from 'rxjs';
import { mergeMap } from 'rxjs/operators';

...

//emit 'Hello'
const source = from(new Promise(resolve => resolve('Hello')));
//map to inner observable and flatten
const example = source.pipe(mergeMap(val => of(`${val} World!`)));
//output: 'Hello World!'
const subscribe = example.subscribe(val => console.log(val));
Youssef Talha