TanStackT
TanStack3y ago
19 replies
worthy-azure

Any guidance / examples on react-query + handling live websocket events?

Hey react-query community, we're working on an application that will have a live-updating list of items.

We are currently using react-query alongside cursor-based pagination + infinite queries to fetch data.
However, we want to also integrate with websocket events (new item, delete item, modify item, etc.) so that we don't need to constantly refetch (polling).

We want to be cautious to not produce bugs with duplicate items, missing items, or malformed data in general.

Is there any guidance or good code examples for this scenario? Thank you! :reactquery:
Was this page helpful?