Skip to content

Cursor direction encoded as part of a cursor #67

@Virviil

Description

@Virviil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions