-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: add async/await support to useQuery #127
Comments
It doesn't defeat the purpose of the library 😄 . I think it makes sense if you want to use it with suspense. You can then just await the refresh() call: const { data, refresh } = useQuery({ /* ... */ })
await refresh() I haven't tried it thought, but it should work. In practice I would actually go for data loaders instead of Suspense |
Another way to utilize the caching layer is to manipulate the Query Cache. You can access the Query Cache using the However, it would be very good to have this feature in the library. |
Or you can just call refresh 😄 |
Thank you guys. I think this library could indeed need sync support.
|
Feature request: add async/await support to useQuery to enable fetching synchronously.
I know this defeats the purpose of state management (thus the whole project) a bit but it would be nice to use the caching layer while fetching data synchronously.
The text was updated successfully, but these errors were encountered: