Tiger Abrodi 🐆
12/01/2021, 4:02 PMjs
React.useEffect(() => {
if (!room) {
return
}
const onDeleteRoomSubscription = supabase
.from<Room>(`rooms:id=eq.${room.id}`)
.on('DELETE', () => {
toast.success(`Room ${room.title} was deleted!`)
push('/rooms')
})
.subscribe()
return () => {
supabase.removeSubscription(onDeleteRoomSubscription)
}
}, [push, room])
const deleteRoom = async () =>
await supabase.from<Room>('rooms').delete().eq('id', roomId).single()
I can delete a room, but the realtime stuff ain't happening, the code within the subscription, been console logging all over the place 😒Tiger Abrodi 🐆
12/01/2021, 4:03 PMTiger Abrodi 🐆
12/01/2021, 4:04 PM