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

hasMore false after add #1

Open
grydstedt opened this issue Feb 14, 2020 · 0 comments
Open

hasMore false after add #1

grydstedt opened this issue Feb 14, 2020 · 0 comments

Comments

@grydstedt
Copy link

grydstedt commented Feb 14, 2020

Hey, thanks for this useful hook.

I noticed when I do an add the hasMore is set to false.

 const {items, loading, loadingMore, hasMore, loadMore} = usePagination(
    app
      .firestore()
      .collection(CHAT_COLLECTION)
      .where('room', '==', roomId)
      .orderBy('created', 'desc'),
    {
      limit: MAX_LIMIT
    }
  );

then later:

        app
          .firestore()
          .collection(CHAT_COLLECTION)
          .add({
            id: random(),
            message,
            from: userId,
            created: new Date(),
            room: roomId
          });

After the add, hasMore is set to false even though there are more documents in the collection

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