TanStackT
TanStack4mo ago
27 replies
brilliant-lime

How to setup debouncing correctly?

I've seen this feature proposal for Serialized Transaction Queuing Utility but was wondering if you had any recommendation to set debounced updates properly in the mean time?

I tried writing a wrapper over onUpdate that associate an async debouncer from Tanstack Pacer with the onUpdate call using the mutation key (I only care for the first mutation in the transaction), but it kinda breaks the "reconciliation" with previous refetches.

My use cases are inputs like text boxes, sliders, are really any kind of input that needs optimistic updates with a debounced persistence.
Was this page helpful?