Replies: 1 comment 2 replies
-
why not keep the error and remove it in Also, if you add |
Beta Was this translation helpful? Give feedback.
2 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.
-
Hey everyone.
I've been trying for a while to create a simple todos crud with offline support but there are still some missing points that I couldn't figure out. So basically I'm using createAsyncStoragePersistor in react-native to persist the data.
Then for example, when the user does not have internet,
onMutate
works great to optimistically add the new todo in the query as inI'm wondering how should I delete this todo when the user does not have internet.
Since the user is not connected, it would throw an error, but I realize that returning a resolved promise and removing it in the
onSuccess
does the trick.What do you think? Does it make sense?
Another approach I guess could be directly accessing
queryClient.setQueryData
I appreciate any help. Thanks in advance 😄
Beta Was this translation helpful? Give feedback.
All reactions