this.realtime?.unsubscribe()
this.realtime = this.ss.client
.channel(`public:contact:id=eq.${contact.id}`)
.on(
'postgres_changes',
{
event: 'UPDATE',
schema: 'public',
table: 'contact',
filter: `id=eq.${contact.id}`,
},
({new: contact}) => {
console.log('contact', contact)
this.contact = contact
}
).subscribe()
this.realtime?.unsubscribe()
this.realtime = this.ss.client
.channel(`public:contact:id=eq.${contact.id}`)
.on(
'postgres_changes',
{
event: 'UPDATE',
schema: 'public',
table: 'contact',
filter: `id=eq.${contact.id}`,
},
({new: contact}) => {
console.log('contact', contact)
this.contact = contact
}
).subscribe()