Replies: 2 comments 1 reply
-
I'm pretty sure there is a standard Observable.Range(1, 10)
.Buffer(2, 1)
.Subscribe(v => Console.WriteLine(string.Join(",", v))); prints
|
Beta Was this translation helpful? Give feedback.
1 reply
-
If that is all you need, there is already the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I know this "idea" has already discussions on rx, but i feel those discussions were aside from the real need. So i'm opening a new one.
BufferWithCount(N) should be a rolling (ie: overlapping) buffer emitting the N last (buffered) items each time one new item is added.
Currently, Buffer(N) is only a non overlapping buffer, emitting distinct group of items.
The current behavior of Buffer makes difficult to compare 2 consecutive values. And to emit a new item only when a specific change occurs between those consecutive values.
The idea is to simplify this code:
Into this:
Does this make sense ?
Beta Was this translation helpful? Give feedback.
All reactions