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

nextToken/prevToken for future records #8

Open
andreialecu opened this issue May 20, 2020 · 0 comments
Open

nextToken/prevToken for future records #8

andreialecu opened this issue May 20, 2020 · 0 comments

Comments

@andreialecu
Copy link

andreialecu commented May 20, 2020

Hey, I was looking into this library and was wondering if the following could be supported:

nextToken should be a valid token even if there is no next page. Assume a webpage got a list of messages, but then via websocket it is notified of new data to fetch.

It should be possible to use the cursor to get results that were added in the mean time.

It should be possible to have both a nextToken and a prevToken.

So, as an example, a chat app would work like this:

  1. get 50 latest chat messages (sorted by date: -1)
  2. there should be a way to get "future" messages, once an event comes via websocket
  3. should be also possible to get previous messages, when the user scrolls back and wants to see the chat room history.

In this case, if sorted by date: -1, the nextToken would actually be for old messages, and prevToken would be for future messages.

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

1 participant