Skip to content

Implement pagination for Observable.#1381

Merged
Avasil merged 4 commits into
monix:series/3.xfrom
Wosin:implement-pagination
Mar 5, 2021
Merged

Implement pagination for Observable.#1381
Avasil merged 4 commits into
monix:series/3.xfrom
Wosin:implement-pagination

Conversation

@Wosin

@Wosin Wosin commented Feb 25, 2021

Copy link
Copy Markdown
Contributor

This PR implements pagination as requested in #1360.

@Avasil Avasil left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a scaladoc similar to unfold and unfoldEval?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Wanted to get the opinion on the implementation first. I will add this today!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Avasil
Avasil merged commit 11dc2c8 into monix:series/3.x Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants