-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
reexecuteQuery for jotai/urql #666
Comments
I wasn't aware the reexecute feature. I don't know how I missed it. We have "refetch" feature in |
Actually, it doesn't work like |
In urql it gets returned separately from the result object.
…On Fri, Aug 20, 2021, 06:39 Daishi Kato ***@***.***> wrote:
Actually, it doesn't work like jotai/query. 🤔
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#666 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPBB6CHUIQQIVHXQK7PR6LT5XFAHANCNFSM5COK5IYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
I'd be happy to contribute code if we can agree on a spec.
For now in my app I had to comment out Jotai and replace it with a pure
urql query for the specific place where I needed refetch.
So Im available to contribute
On Fri, Aug 20, 2021, 09:48 Danny Povolotski ***@***.***>
wrote:
… In urql it gets returned separately from the result object.
On Fri, Aug 20, 2021, 06:39 Daishi Kato ***@***.***> wrote:
> Actually, it doesn't work like jotai/query. 🤔
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#666 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAPBB6CHUIQQIVHXQK7PR6LT5XFAHANCNFSM5COK5IYQ>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
> or Android
> <https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
> .
>
|
Please try if https://ci.codesandbox.io/status/pmndrs/jotai/pr/668 works. |
Well, I should have asked for your help from the beginning. Next time. I will merge #668 soon. |
@dai-shi I'll test it today & let you know that it works! |
Okay, I will wait. (I was about to cut a release.) |
Well, I think we can release it, and if something goes wrong, we'll fix it ASAP. |
I tested it, the refetching it self seems to work, but if I understand correctly, I now can't know about the fact that it is refetching/refreshing? In vanilla |
Yeah, that was my question too actually. For now, it will throw a promise, so it suspends on refetch just like the first fetch, right? This behavior is consistent with |
@dai-shi vanilla For example, in my current use-case with React Native, the actually has a Another example is when an initial load is done on something like a feed & you'd want to fetch in the background and only re-rendering if new items appear without indicating a loader to the user. |
Yeah, Apart from jotai, I wonder how drag to refersh and background refetch will be implemented as best practices in Suspense era. |
That util would be the perfect temporary measure for now, until the world
figures out new design patterns 👍
You're absolutely right, this is a case of a future pattern not yet having
gone through enough discovery to find all the right use cases.
However, combined with a util like that one, this makes it perfectly usable
in the real world. I'll jump over there and see what the state of it is.
…On Thu, Aug 26, 2021, 06:56 Daishi Kato ***@***.***> wrote:
Yeah, fetching is in react-urql.
jotai atoms are designed for Suspense and useTransition, which might be
too futuristic for now.
I understand that distinguishing between the initial fetching and
refetching is important in the real use case. We hope to come up with some
ideas for both jotai/urql and jotai/query.
btw, you might be interested in the new util at #672
<#672>. Actually, it could solve
refetching issue there.
Apart from jotai, I wonder how drag to refersh and background refetch will
be implemented as best practices in Suspense era.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#666 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPBB6ANMLCQ7HAAQTYYB6DT6W3QDANCNFSM5COK5IYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Do I understand correctly that there is no mechanism at all to reexecute a query in
jotai/urql
? In the regularurql
hooks there is this method:https://formidable.com/open-source/urql/docs/basics/react-preact/#reexecuting-queries
Not being able to reexecute queries seems like a rather big limitation.
The text was updated successfully, but these errors were encountered: