Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/SupabaseQueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Fetch, GenericObject, SupabaseEventTypes, SupabaseRealtimePayload } fro
export class SupabaseQueryBuilder<T> extends PostgrestQueryBuilder<T> {
private _subscription: SupabaseRealtimeClient | null = null
private _realtime: RealtimeClient
private _headers: { [key: string]: string }
private _headers: GenericObject
private _schema: string
private _table: string

Expand Down
11 changes: 3 additions & 8 deletions src/lib/SupabaseRealtimeClient.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { RealtimeSubscription, RealtimeClient, Transformers } from '@supabase/realtime-js'
import { SupabaseEventTypes, SupabaseRealtimePayload } from './types'
import { GenericObject, SupabaseEventTypes, SupabaseRealtimePayload } from './types'

export class SupabaseRealtimeClient {
subscription: RealtimeSubscription

constructor(
socket: RealtimeClient,
headers: { [key: string]: string },
schema: string,
tableName: string
) {
const chanParams: { [key: string]: string } = {}
constructor(socket: RealtimeClient, headers: GenericObject, schema: string, tableName: string) {
const chanParams: GenericObject = {}
const topic = tableName === '*' ? `realtime:${schema}` : `realtime:${schema}:${tableName}`
const userToken = headers['Authorization'].split(' ')[1]

Expand Down