T
TanStack3y ago
sensitive-blue

Is there a way to use useMutation with debounce?

Hi, I'm trying to prevent user from spamming with likes, is there a way to show optimistic updates without actually sending the mutation request? Thanks 🙂
2 Replies
other-emerald
other-emerald3y ago
I'm not aware of anything that will let you debounce mutations in react query. Your best bet is probably debouncing and updating the UI yourself and then finally calling mutate(idsOfPostsToLike)
sensitive-blue
sensitive-blueOP3y ago
Thanks a lot! 🙏

Did you find this page helpful?