I have a publish relay which emits items regularly, I just want to get the last tow items each time it emits, the case is to evaluate UI state according to previous and current emissions
Mohamed Ibrahim
04/30/2019, 12:55 PM
I solved it using buffer(count)
g
gsala
04/30/2019, 2:41 PM
If you
buffer
the stream you don't get the items every time it emits, only when the buffer is full. I think you need something like