Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pagination for Observable. #1381

Merged
merged 4 commits into from Mar 5, 2021

Conversation

Wosin
Copy link
Contributor

@Wosin Wosin commented Feb 25, 2021

This PR implements pagination as requested in #1360.

Copy link
Collaborator

@Avasil Avasil left a comment

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!

@@ -5632,6 +5632,12 @@ object Observable extends ObservableDeprecatedBuilders {
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
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
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
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
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.

None yet

3 participants