https://supabase.com/ logo
You will need to provide more info on your environ...
# javascript
g
You will need to provide more info on your environment, what you have tried, etc. Please start a thread if you reply. Also "does not update instantly" ... does that mean it does update, just you are not happy with the timeframe?
t
Hey @garyaustin
Copy code
useEffect(() => {
    fetchData();
    const mySubscription = supabase
      .from("posts")
      .on("*", () => fetchData())
      .subscribe();
    return () => mySubscription.unsubscribe(mySubscription);
  }, []);
here is the code i am using to implement the realtime update feature in Nextjs
So basically, once i hit the create post button and a post is created i want to be able to see it on the homepage where i am rendering all posts but it does not update automatically....until in reload the page myself
g
Is your subscription triggering? Can you see the websocket in the network tab? Are there messages going back and forth. So many possibilities from realtime setup to what ever fetchData does... You might read thru this from recently debugging next.js and realtime... https://discord.com/channels/839993398554656828/997205421217558529 You can also put .subscribe((status)=>{console.log(status)}) to get status of subscription.
t
alright thanks mate...will go through the options provided and let you know