Buffer

Buffer will hold on to events emitted by the source observable sequence until the specified time span in seconds has passed or the count of buffered items has been reached, whichever happens first. Then, it will emit an observable array of the buffered events. Passing zero for the timeSpan argument and specifying the time span and passing zero for count; ignores count, that is, we are trying to do this:

buffer(timeSpan: 0.0, count: 0, scheduler: scheduler)

In this case, count will be ignored. We will cover schedulers later in detail:

We will insert a buffer before scan . In this example, we are not concerned with time elapsing, so we ...

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.