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

Cursor direction encoded as part of a cursor #67

Open
Virviil opened this issue Aug 20, 2024 · 1 comment
Open

Cursor direction encoded as part of a cursor #67

Virviil opened this issue Aug 20, 2024 · 1 comment

Comments

@Virviil
Copy link

Virviil commented Aug 20, 2024

Is there any reason why it's not implemented?

Why should I provide my after or before cursor calling right function, instead of just providing A CURSOR which has the info about if it goes forward or backward?

cursor := p.Paginate(....)
{
   after: base64encode([after, after_cursor_data])
   before: base64encode([before, before_cursor_data])
}

Now after i get cursor from api, i just provide it as_is:

opts = append(opts, paginator.WithCursor(cursor))

which is parsed internally to get information about if it's after or before.

@pilagod
Copy link
Owner

pilagod commented Sep 24, 2024

This issue @sashahilton00 and I also discussed in the pull request #66 (comment).

Appreciate for your feedbacks on this topic 🙌 and I would like to collect more thoughts from the community, since this change would introduce a new mindset to use this library, which is quite different from the old days.

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

No branches or pull requests

2 participants