From 0e3112657df758bbfbdcab365359728ec0179bb1 Mon Sep 17 00:00:00 2001 From: Phoenix <63447220+PhoenixCreation@users.noreply.github.com> Date: Tue, 25 May 2021 12:08:59 +0530 Subject: [PATCH] fix: type error for callback of on() Parameter of callback function of on() should have SupabaseRealtimePayload type instead of any Function. --- src/lib/SupabaseRealtimeClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/SupabaseRealtimeClient.ts b/src/lib/SupabaseRealtimeClient.ts index 10ecda0c..05ed3b87 100644 --- a/src/lib/SupabaseRealtimeClient.ts +++ b/src/lib/SupabaseRealtimeClient.ts @@ -32,7 +32,7 @@ export class SupabaseRealtimeClient { * @param event The event * @param callback A callback function that is called whenever the event occurs. */ - on(event: SupabaseEventTypes, callback: Function) { + on(event: SupabaseEventTypes, callback: (payload: SupabaseRealtimePayload) => void) { this.subscription.on(event, (payload: any) => { let enrichedPayload: SupabaseRealtimePayload = { schema: payload.schema,