How to update the data for all the users on a POST request #1043
-
Hi, await axios.post("/api/post", data) So now I want the data (which is displayed on the homepage) to be updated for user B as well as user A using swr. Now the thing is, I don't want to revalidate the data on focus or interval. If user A is looking at the browser window, the data for them should update right away in front of his eyes and should not require him to switch tabs or anything. How can I implement this? I'm searching this for hours and haven't found any answer. This is basically optimistic UI but for each and every user? I have looked up on many examples but according to me, its only updating the data for the user who is actually making the POST request and not for other users. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Why that ? How would you proceed to do what you want with any other tool / library anyway ? |
Beta Was this translation helpful? Give feedback.
-
Hmm... This can be done with sockets only i think. I was wondering if it was possible the same way with swr |
Beta Was this translation helpful? Give feedback.
Hmm... This can be done with sockets only i think. I was wondering if it was possible the same way with swr