useEffect and useQuery

I am trying to useEffect with useQuery. My purpose is removing item from collection when someone clicks the delete button. I do not want to refresh page, so i have to use useEffect. I tried something like that, but no change. Do you have any idea about how i can do that?
No description
No description
3 Replies
matijash
matijash•2y ago
hmm sounds like an optimistic UI update that you are trying to do? Wasp has native support for that: https://wasp-lang.dev/docs/language/features#the-useaction-hook (look for optimisticUpdate property) Optimistic UI Update - when you want to update UI without waiting for the server response, to avoid the lag in the UX
delirehberi
delirehberiOP•2y ago
Ah, right. Why i am looking for another way. Sorry for that.
matijash
matijash•2y ago
no worries, hope this helps! let us know 🙂
Want results from more Discord servers?
Add your server