okay, in case somebody needs it, here is a extensi...
# rx
u
okay, in case somebody needs it, here is a extension function
Copy code
fun <T> Observable<T>.withCachedValues(cache: Array<T?>): Observable<Array<T?>> {
    return scan(cache) { accumulator, new ->
        val size = accumulator.size
        System.arraycopy(accumulator, 1, accumulator, 0, size - 1);
        accumulator[size - 1] = new
        accumulator
    }.skip(1)
}