Using react query to distribute state when using with web sockets
If it is not advised to use react query to distribute some state in app, why connecting query with websocket is a suggested pattern.
References:
1. https://tkdodo.eu/blog/practical-react-query#dont-use-the-querycache-as-a-local-state-manager
2. https://tkdodo.eu/blog/using-web-sockets-with-react-query#partial-data-updates
3.https://tanstack.com/query/latest/docs/react/reference/QueryClient#queryclientsetquerydata
I was hoping i could do something like below to keep my multiple chat(1) floating windows in sync doing something along these lines:
References:
1. https://tkdodo.eu/blog/practical-react-query#dont-use-the-querycache-as-a-local-state-manager
2. https://tkdodo.eu/blog/using-web-sockets-with-react-query#partial-data-updates
3.https://tanstack.com/query/latest/docs/react/reference/QueryClient#queryclientsetquerydata
I was hoping i could do something like below to keep my multiple chat(1) floating windows in sync doing something along these lines:
QueryClient
The QueryClient can be used to interact with a cache:
The QueryClient can be used to interact with a cache:
Let me share with you the experiences I have made lately with React Query. Fetching data in React has never been this delightful...

A step-by-step guide on how to make real-time notifications work with react-query
