Spacing network requests with `useMutation`
We have an audio player, each second a mutation sends a POST to persist the user's progression.
We don't really need to be that precise, and it would be ok for us to only send that post every 5 or 10s.
Something like this might work:
Is there a better way to do this ?
1 Reply
rising-crimson•3y ago
How are you calling mutate? I'd keep conditional logic like that out of the mutation function and instead consider a form of throttling outside of the context of TanStack Query