Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

storing actual function since ref was storing undefined

awalias7a97e2cb49ac
diff --git a/libraries/supabase-js/src/Supabase.js b/libraries/supabase-js/src/Supabase.js
index c9d6c0ceb07..c91ab7e9bee 100644
--- a/libraries/supabase-js/src/Supabase.js
+++ b/libraries/supabase-js/src/Supabase.js
@@ -47,6 +47,7 @@ class Supabase {
this.tableName == '*'
? 'realtime:*'
: `realtime:${this.schema}:${this.tableName}${filterString}`
+ console.log(channel)
this.socket = new Socket(socketUrl, { params: { apikey: this.apikey } })
this.channel = this.socket.channel(channel)
@@ -61,7 +62,7 @@ class Supabase {
on(eventType, callbackFunction) {
if (this.socket == null) this.createListener()
- var ref = this.channel.on(eventType, payload => {
+ this.channel.on(eventType, payload => {
let payloadEnriched = {
schema: payload.schema,
table: payload.table,
@@ -112,7 +113,7 @@ class Supabase {
callbackFunction(payloadEnriched)
})
- this.listeners[eventType] = ref
+ this.listeners[eventType] = callbackFunction
return this
}