From ff47621180411b49ba5ded4a1214eea922418061 Mon Sep 17 00:00:00 2001 From: wisplite Date: Tue, 21 Apr 2026 22:49:23 -0500 Subject: [PATCH] small update --- dist/index.d.ts | 2 +- dist/index.js | 9 +++++---- src/index.ts | 9 +++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 1060551..00cc7a8 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -3,7 +3,7 @@ export declare class TetherClient { private subscribedQueries; connect: (url: string) => void; disconnect: () => void; - subscribe: (query: string, callback: (data: any) => void) => void; + subscribe: (queryName: string, params: any, callback: (data: any) => void) => void; unsubscribe: (query: string) => void; sendMutation: (mutationName: string, params: any) => void; } diff --git a/dist/index.js b/dist/index.js index 5fdf914..8640e70 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14,11 +14,12 @@ export class TetherClient { disconnect = () => { this.websocketHandler.close(); }; - subscribe = (query, callback) => { - this.subscribedQueries.set(query, callback); + subscribe = (queryName, params, callback) => { + this.subscribedQueries.set(queryName, callback); this.websocketHandler.send(JSON.stringify({ type: 'subscribe', - query: query + location: queryName, + params: params })); }; unsubscribe = (query) => { @@ -32,7 +33,7 @@ export class TetherClient { this.websocketHandler.send(JSON.stringify({ type: 'mutation', name: mutationName, - payload: params, + params: params, })); }; } diff --git a/src/index.ts b/src/index.ts index d495b3d..d53b329 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,11 +17,12 @@ export class TetherClient { this.websocketHandler.close(); }; - subscribe = (query: string, callback: (data: any) => void) => { - this.subscribedQueries.set(query, callback); + subscribe = (queryName: string, params: any, callback: (data: any) => void) => { + this.subscribedQueries.set(queryName, callback); this.websocketHandler.send(JSON.stringify({ type: 'subscribe', - query: query + location: queryName, + params: params })); }; @@ -37,7 +38,7 @@ export class TetherClient { this.websocketHandler.send(JSON.stringify({ type: 'mutation', name: mutationName, - payload: params, + params: params, })); }; } \ No newline at end of file