Buffering
The buffer() operator will gather emissions into collections according to a specified criteria. The default collection type is as a list, but a different collection type can be specified.You can specify a count, and the buffer operator will group emissions into lists with a size equal to the count, with the exception of the last list, which will contain the remainder of what couldn't be divided equally.
You can additionally specify a skip amount as well, which determines how far to move forward for the start of each list. If no skip is given it defaults to be the same as the count operator so as to break them into distinct groups. But if, for instance, you specify a count of 2 and a skip of 1, then each list will have 2 elements, but the start of a list will only be one more than the start of the previous list, which will cause the last element of the previous list the first element of the current list to be the same. This can be very useful for operations where you need to know both the current emission and the previous emission to do something.
You can also buffer based off of time, so that all emissions within a specified time are grouped together. There is also a timeSkip option, which is the time based equivalent of skip. There is also an optional count operation, so that it will group based off of whichever is reached first, the time or the count.
Additionally, buffer can take another Observable as a parameter, and anytime that Observable emits serves as the cutoff point for grouping.