Implement pagination for Observable.#1381
Conversation
Avasil
left a comment
There was a problem hiding this comment.
The implementation looks great, thank you!
| def unfoldEval[S, A](seed: => S)(f: S => Task[Option[(A, S)]]): Observable[A] = | ||
| new UnfoldEvalObservable(seed, f) | ||
|
|
||
| def paginate[S, A](seed: => S)(f: S => (A, Option[S])): Observable[A] = |
There was a problem hiding this comment.
Could you please add a scaladoc similar to unfold and unfoldEval?
There was a problem hiding this comment.
Sure! Wanted to get the opinion on the implementation first. I will add this today!
There was a problem hiding this comment.
I've added doc, that is written as comparison to unfold and unfoldEval. I thought that would be easiest to understand, but I've also noticed that most of the functions have separate docs that do not depend on other functions so let me know if You would want me to change :)
There was a problem hiding this comment.
I think it's fine in this case since those are very similar methods.
It might be cool to add @see in unfold / unfoldEval that would mention paginate / paginateEval
This PR implements pagination as requested in #1360.