javarx-javareactive-programmingreactivex

Aggregate all emited streams and emit them inmidiatly with rxJava


I have a stream that emit pages of data A, B, C, D.... Which operator can I use to get a stream like this: [A], [A, B], [A, B, C], [A, B, C, D]...?

I know collect or toList but they only emit once at the end of the stream.


Solution

  • You can try the 'scan' operator.