Skip to content

Commit

Permalink
Merge pull request #346 from supabase/chore/refactor
Browse files Browse the repository at this point in the history
chore: replace existing type defs with GenericObject type
  • Loading branch information
w3b6x9 committed Jan 21, 2022
2 parents e4d41d5 + ba0c0e2 commit e5c049b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
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

0 comments on commit e5c049b

Please sign in to comment.