feat(): v2 public websockets & reusable base class for websockets

This commit is contained in:
Tiago Siebler
2023-11-14 15:39:53 +00:00
parent ea8fac777e
commit 8346e88a3b
11 changed files with 1054 additions and 97 deletions

View File

@@ -1,4 +1,4 @@
import { WebsocketClient, WsClientEvent } from '../src';
import { WebsocketClient } from '../src';
export function getSilentLogger(logHint?: string) {
return {
@@ -20,6 +20,15 @@ export const fullLogger = {
error: (...params) => console.error('error', ...params),
};
type WsClientEvent =
| 'open'
| 'update'
| 'close'
| 'exception'
| 'reconnect'
| 'reconnected'
| 'response';
/** Resolves a promise if an event is seen before a timeout (defaults to 4.5 seconds) */
export function waitForSocketEvent(
wsClient: WebsocketClient,