Skip to content

Commit e5c049b

Browse files
authored
Merge pull request #346 from supabase/chore/refactor
chore: replace existing type defs with GenericObject type
2 parents e4d41d5 + ba0c0e2 commit e5c049b

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/lib/SupabaseQueryBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Fetch, GenericObject, SupabaseEventTypes, SupabaseRealtimePayload } fro
66
export class SupabaseQueryBuilder<T> extends PostgrestQueryBuilder<T> {
77
private _subscription: SupabaseRealtimeClient | null = null
88
private _realtime: RealtimeClient
9-
private _headers: { [key: string]: string }
9+
private _headers: GenericObject
1010
private _schema: string
1111
private _table: string
1212

src/lib/SupabaseRealtimeClient.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import { RealtimeSubscription, RealtimeClient, Transformers } from '@supabase/realtime-js'
2-
import { SupabaseEventTypes, SupabaseRealtimePayload } from './types'
2+
import { GenericObject, SupabaseEventTypes, SupabaseRealtimePayload } from './types'
33

44
export class SupabaseRealtimeClient {
55
subscription: RealtimeSubscription
66

7-
constructor(
8-
socket: RealtimeClient,
9-
headers: { [key: string]: string },
10-
schema: string,
11-
tableName: string
12-
) {
13-
const chanParams: { [key: string]: string } = {}
7+
constructor(socket: RealtimeClient, headers: GenericObject, schema: string, tableName: string) {
8+
const chanParams: GenericObject = {}
149
const topic = tableName === '*' ? `realtime:${schema}` : `realtime:${schema}:${tableName}`
1510
const userToken = headers['Authorization'].split(' ')[1]
1611

0 commit comments

Comments
 (0)