Iām trying to get the records from a table in real time, but I only get the data once on page load, useMoralisSubscription is not detecting when I add new records, what could I be doing wrong?
const { data: notifications, error: notificationsError, isLoading: notificationsLoading } = useMoralisQuery(
"Notifications",
query => query,
[],
{
live: true,
},
);
useMoralisSubscription('Notifications', (q) => q, [], {
onUpdate: (data) => {
console.log(data);
},
onCreate: (data) => {
console.log(data);
},
onEnter: (data) => {
console.log(data);
},
onLeave: (data) => {
console.log(data);
},
});