Need Help with real-time subscription on react
# help
m
Need Help with real-time subscription on react
Hey guys need a bit of help on the implementation of real time subscription. Currently I have this code inside one of my React pages:
Copy code
js
useEffect(() => { 
        GameServices.getPerson(setAdmin)
        GameServices.getTeams(setTeams);
        GameServices.getTime(setTime);
        supabaseClient
            .from('*')
            .on('*', payload => {
                console.log('Change received!', payload)
                GameServices.getTeams(setTeams);
                GameServices.getTime(setTime);
                console.log('Change received!', payload)
        }).subscribe((status)=>{console.log('subscribe',status);})
    },[]);
On the console I can see that the subscription status is SUBSCRIBED, and I currently have Replication enabled for all events and for all tables in my DB. I'm also using RLS policies.