Home > Enterprise >  How add all arrays to one in rxjs
How add all arrays to one in rxjs

Time:06-01

how i can add all arrays to one in rxjs for this code?

someObs$ = this.getSomeData$().pipe(
    mergeMap(res => res),
    groupBy(el => el.class),
    mergeMap(group$ => group$.pipe(toArray())),
    // how in this place create something like this: [[{},{}], [{},{}], [{},{}]]
    shareReplay(1)
  )

Thanks for help

CodePudding user response:

I found solution for this: operator toArray()

CodePudding user response:

getSomeData() --> what kind of return does it have?

CodePudding user response:

RxJS Doc definition of enter image description here

  • Related