Skip to content

Commit 801bfd1

Browse files
committed
refactor: GenericObject -> Record
1 parent bd03b65 commit 801bfd1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/lib/SupabaseRealtimeClient.ts

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

44
export class SupabaseRealtimeClient {
55
channel: RealtimeChannel
66

77
constructor(socket: RealtimeClient, name: string, token: string, opts?: { [key: string]: any }) {
8-
let chanParams: GenericObject = { user_token: token }
8+
let chanParams: Record<string, string> = { user_token: token }
99

1010
if (opts) {
1111
chanParams = { ...chanParams, ...opts }
@@ -40,7 +40,7 @@ export class SupabaseRealtimeClient {
4040
*/
4141
on(
4242
event: string,
43-
filter?: GenericObject,
43+
filter?: Record<string, string>,
4444
callback?: (payload: SupabaseRealtimePayload<any>) => void
4545
) {
4646
this.channel.on(event, filter ?? {}, (payload: any) => {

src/lib/types.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ type GoTrueClientOptions = ConstructorParameters<typeof GoTrueClient>[0]
55

66
export interface SupabaseAuthClientOptions extends GoTrueClientOptions {}
77

8-
export type GenericObject = { [key: string]: string }
9-
108
export type Fetch = typeof fetch
119

1210
export type SupabaseClientOptions = {
@@ -17,7 +15,7 @@ export type SupabaseClientOptions = {
1715
/**
1816
* Optional headers for initializing the client.
1917
*/
20-
headers?: GenericObject
18+
headers?: Record<string, string>
2119
/**
2220
* Automatically refreshes the token for logged in users.
2321
*/

0 commit comments

Comments
 (0)