I am using RxJava/Kotlin Observable#take() to get first 50 items from the list. But #take() operator is not behaving as it should as per Rx docs.
In Rx docs, #take() is defined as:
"Emit only the first n items emitted by an Observable"
I have a function like this:
As we can see the pageSize argument is 50
And initial size of the list is 300
After that #take(50) is applied to that Observable and at next breakpoint I still get the full size list i.e. size = 300
But just for the check, if something is wrong with the debugger or observable, I tried to take only items whose displayName contains "9", but this time I get the expected result of smaller list with 9 in each of their #displayName field.
I believe RxJava/Kotlin's #take() operator is not that crazy and it's just me.





Observable.take()operator considers emissions of the observable, not the size of the list emitted. So if yourremoteFollowersService.getFollowers()would emit more than 50 items it would return only first 50 of them. - iluu