2021-02-25

Get an array of 4 elements with RxJS

Trying to get data from firebase, but grouped 4 by 4. How would I manage to group and return an observable of 4 in 4.

# input
# [1, 2, 3, 4, 5, 6, 7, 8]

# output
# [ [1,2,3,4], [5, 6, 7, 8]...]

I have tried this, but it only takes the first 4 and returns an array and not as an observable

this.data$ = this.afs
      .collection<Data>('data')
      .valueChanges()
      .pipe(take(4), toArray());


from Recent Questions - Stack Overflow https://ift.tt/2Nt5TJ1
https://ift.tt/eA8V8J

No comments:

Post a Comment