Skip to main content

mergeMapObservablePipe

Alternative: mergeMap$$$

Inlined: mergeMapObservable, mergeMap$$$

Types

function mergeMapObservablePipe<GIn, GOut>(
mapFunction: IMapFunction<GIn, IObservable<GOut>>,
maxNumberOfSubscriptions?: number,
): IObservablePipe<GIn, GOut>

Definition

This function is equivalent to:

pipe$$(subscribe, [
map$$$<GIn, IObservable<GOut>>(mapFunction),
mergeAll$$$<GOut>(maxNumberOfSubscriptions),
]);

See mapObservablePipe and mergeAllObservablePipe.

The RxJS equivalent is mergeMap.

Example

After 2000ms, return another Observable with the values 1, 2, 3

const subscribe = pipe$$(timeout(2000), [
mergeMap$$$(() => of(1, 2, 3)),
]);

subscribe((value) => {
console.log(value);
});

Output:

// t = 2000ms
1
2
3