asliwinskiA

Implementation of bi-directional cursor-based pagination

I'm looking at the example for useInfiniteQuery and I'm trying to make it bi-directional. I know I need to pass getPreviousPageParam that returns the second cursor, but I don't see any obvious way to pass the direction information to the procedure. What would be the recommended way to do it?
  • Your procedure needs to accept a cursor input of any type (string, number, etc)
Was this page helpful?
Implementation of bi-directional cursor-based pagination - tRPC