Fetching state for on-demand collections (for use with useLiveQuery) #1111
joshuadutton
started this conversation in
Ideas
Replies: 1 comment
-
|
I just noticed these properties on /** Check if query is currently fetching (initial or background) */
isFetching: boolean;
/** Check if query is refetching in background (not initial fetch) */
isRefetching: boolean;
/** Check if query is loading for the first time (no data yet) */
isLoading: boolean;
/** Get current fetch status */
fetchStatus: `fetching` | `paused` | `idle`;But It's not clear yet if I can subscribe to those state changes. I guess I could write a custom hook that polls for those changes for a given collection. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using an on-demand query collection. If I'm fetching specific records for the first time, I want to show a loading indicator. When using on-demand, getting an empty array can mean either the data isn't found or it's still fetching. And the loading state only applies to the collection's initial load.
For now, I'm using a workout that shows loading when there is an absence of data and then not found after a timeout.
Beta Was this translation helpful? Give feedback.
All reactions