I am new to RxJS. I have specific array which I am using the Observable.
[a,b,c,d,e,f,g,h]
I want to handle the back pressure and handle 3 elements everytime.
I want to split this up like this and emit:
[a,b,c] [d,e,f] [g,h]
I am using bufferCount(3) for this. But the problem with bufferCount is this it does emit the last interval. As the last interval has only 2 elements in it.
This is my sample code
from(streamOfArr$).pipe(
flatMap(somefunc()),
bufferCount(3),
tap((x) => {
console.log('3', x);
}),
flatMap(somefunc1()),
How can I emit the last interval in bufferCount.
I believe there is another problem here.
If you see this example: https://stackblitz.com/edit/rxjs-3jwznz
You will see that bufferCount emits the last interval (even if the last one has only 2). Are you sure your source observable is completing?