Skip to content
This repository was archived by the owner on Dec 20, 2022. It is now read-only.

Latest commit

 

History

History
44 lines (33 loc) · 886 Bytes

File metadata and controls

44 lines (33 loc) · 886 Bytes

mergeMapObservablePipe or mergeMap$$$

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

This function is equivalent to:

pipeObservablePipes(subscribe, [
  mapObservablePipe<GIn, IObservable<GOut>>(mapFunction),
  mergeAllObservablePipe<GOut>(maxNumberOfSubscriptions),
]);

See mapObservablePipe and mergeAllObservablePipe

The RxJS equivalent is mergeMap

Examples

Example 1

const subscribe = pipeObservable(timeout(2000), [
  mergeMapObservablePipe(() => of(1, 2, 3)),
]);

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

Output:

// 2000ms
1
2
3