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

Consider how to avoid the need for an unwrap in PaginatedResult.next #11

Open
lawrence-forooghian opened this issue Aug 15, 2024 · 0 comments
Labels
enhancement New feature or improved functionality.

Comments

@lawrence-forooghian
Copy link
Collaborator

lawrence-forooghian commented Aug 15, 2024

The PaginatedResult type introduced in #9 is currently just copied from the JS type. I think the intention is that you check hasNext, and then, if it’s true, next will return a non-nil value. But the compiler doesn't know this, so you still have to unwrap next. Think about an API that avoids this; probably would be an enum where the "has next" case has an associated value that lets you load the non-optional next page.

┆Issue is synchronized with this Jira Story by Unito

@lawrence-forooghian lawrence-forooghian added the enhancement New feature or improved functionality. label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

1 participant