then I suppose you want it to accumulate the pages...
# rx
a
then I suppose you want it to accumulate the pages in that list, so this should make sense:
Copy code
fun getPagesFrom(page: Int): Flowable<List<Data>> = makeRequest(page)
        .flatMapPublisher {
            Flowable.just(it.data)
                    .concatWith(it.nextPageId?.let(::getPagesFrom) ?: Flowable.empty())
        }

fun getData(): Flowable<List<Data>> = getPagesFrom(0).scan { acc, page -> acc + page }