How do you do it? RxJs is still a mystery to me.
I was trying stuff like:
filterChanges
.delay(400)
.replay()
.reduce(function(acc,x) { return acc.concat(x) }, [])
.subscribe(function(changes) {
console.log(changes);
...
Or
filterChanges.subscribe(function() {
filterChanges.aggregate(function(changes) {
...
I'm really pretty lost here. The behavior I want is: certain user actions result in multiple filter changes. I don't want to process them one at a time, but only when the spurt of changes is finished. But when I process them I want all the filter changes from the beginning of the stream.
Now that I write this, I realize it would be better to just get all the the filters after a spurt of changes, not all the changes themselves, so I just need to catch the end of a spurt. I'd like the answer to both questions because I think it will help me understand RxJs better.
- Subscribe to the end of a burst of events.
- Subscribe to the end of a burst of events and capture all events from the beginning of the stream.