-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
useCollection: new fetchOnMount option #1326
base: master
Are you sure you want to change the base?
Conversation
I was thinking of a use case for the exact opposite too: We could name that
Why |
You suggest to set a
The react-query doc says to use |
I was rather thinking of prefetching a certain number of items so that we can ensure that a page is filled with a sufficient number of items?
I think this might be a bit unintuitive to have two different approaches, depending on how many items were preloaded? |
I don't understand. This is the current default behaviour: every time we use |
Sorry, I think I wasn't very clear :) |
Indeed that seems useful. And if we don't want to prefetch any items, we can just set I would expect |
Add a new
fetchOnMount
option to the useCollection hook.If false (true by default), the collection will not be fetched on load but can be fetched later with the
refetch
For the
useInbox
anduseOutbox
hooks, it is false by default because most of the usages ofuseOutbox
is to post activities, and thus we don't need to fetch the outbox.TODO
refetch
worksuseOutbox
anduseInbox
still work, notably with awaitActivity and liveUpdates