Hey, 2 questions. 1. How can I get the exported e...
# help
r
Hey, 2 questions. 1. How can I get the exported event types? 2. When I subscribe to the delete event type, like so:
Copy code
ts
this.supabase.instance
      .from<definitions['games']>('games')
      .on(SupabaseEventTypes.delete, (payload) => console.log(payload))
      .subscribe();
nothing gets logged. I've enabled full table replica like so:
alter table "games" replica identity full;
but still it doesn't seem to trigger the event for some reason. 🤔
p
alter publication supabase_realtime add table games;
r
What does that do?
is that in the docs?
p
or you can turn it via the UI
lmk if that does work
r
I can try that. although, why only delete doesn't work? insert subscription works
p
oh
not sure
r
I checked, and I have everything enabled there
and all tables added
p
hm
in this case i'd just try "DELETE" instead of SupabaseEventTypes.delete
idk
im just guessing atp
r
speaking of. that It doesn't look like I can import
SupabaseEventTypes
I see its exported in the lib, but can I import it?
p
lemme try
r
I ended up re-defining it, for my project like:
p
import { SupabaseEventTypes } from "@supabase/supabase-js/src/lib/types"
but why are you trying to import it tho?
r
well, for typesafety of course.
but, it looks like the
on(...)
already has it as a type for the argument, so you're right. Don't need to import it 🤦‍♂️
p
yeah, it is already typed
r
cool thx