mirror of
https://github.com/wisplite/tether-ts.git
synced 2026-05-01 06:22:41 -05:00
pass callbacks to client
This commit is contained in:
Vendored
+6
@@ -4,6 +4,12 @@ export class TetherClient {
|
||||
subscribedQueries = new Map();
|
||||
connect = (url) => {
|
||||
this.websocketHandler.startConnection(url);
|
||||
this.websocketHandler.onQuery = (location, data) => {
|
||||
if (location) {
|
||||
const callback = this.subscribedQueries.get(location);
|
||||
callback?.(data);
|
||||
}
|
||||
};
|
||||
};
|
||||
disconnect = () => {
|
||||
this.websocketHandler.close();
|
||||
|
||||
Reference in New Issue
Block a user