I have a publish relay which emits items regularly...
# rx
m
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
I solved it using buffer(count)
g
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
window
or accumulate the state through
scan
👍 1
m
For that I used startWith default value