Replies: 3 comments 2 replies
-
Since socket.io is not promise based and instead stream based, you cannot use the normal Also, yes, |
Beta Was this translation helpful? Give feedback.
-
Ok I understand. I have been doing some advances in this direction that you are telling (stream based socket & queryCache) and it works perfectly. But, in this direction, does it mean that I would not use I mean, I know that the use of Thanks so much for your support and congrats for this great library. |
Beta Was this translation helpful? Give feedback.
-
Yes, you would, but sockets are not transaction based, so there would be nothing to "refetch" if you will. Unless you are using your socket to both request and recieve data, then I guess you could theoretically set up a system where you could:
IMO that's a tone of work for little benefits. If you are considering this, then I would suggest you introspect on your architecture and ask yourself what your true technical requirements are for your data. If you are working with transactional data, then you're going to want a transactional interface, like promises. If you are working with streaming data, then you won't really be able to rely on any transactional features of it any way. |
Beta Was this translation helpful? Give feedback.
-
Hi! I'm trying to use socket.io as fetcher client, but I could not find any info about this.
The only related information I could find is at a SWR issue but I think is not exactly the way it has to be accomplished with React Query.
In comparition with SWR's code, this code
mutate('/api/data', data, false)
has to be replaced usingsetQueryData
?I'm a little confused about this. Any help?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions