#rxjs mergeMap

3 messages · Page 1 of 1 (latest)

dusty stump
#
    this.cartographies$ = this.buildindStoreys$.pipe(
      map((buildindStorey: BuildingStorey[]) => from(buildindStorey)),
      switchMap((val: Observable<BuildingStorey>) => val),
      mergeMap((val: BuildingStorey) => this._cartographyMainService.getCartographies(val.id))
    ).subscribe((r) => console.log('this.cartographies$: ', r));;

result:

this.cartographies$:  (2) [{…}, {…}]
this.cartographies$:  (5) [{…}, {…}, {…}, {…}, {…}]

I get 2 results, I would like to have a single result grouped in a table for example.
I tried with mergeAll or concatAll, without success

i want :

this.cartographies$:  (2) [[{…}, {…}],  [{…}, {…}, {…}, {…}, {…}]]
hardy ivy
dusty stump
#

yeeeah is so easy