Skip to content

Commit cacc82d

Browse files
authored
fix: expose getter on Socket.ts (#200)
1 parent 80da7db commit cacc82d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hume",
3-
"version": "0.9.1",
3+
"version": "0.9.2",
44
"private": false,
55
"repository": "https://github.com/HumeAI/hume-typescript-sdk",
66
"main": "./index.js",

src/api/resources/empathicVoice/resources/chat/client/Socket.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,25 @@ export declare namespace ChatSocket {
2020

2121
export class ChatSocket {
2222
public readonly socket: core.ReconnectingWebSocket;
23-
public readonly readyState: number;
2423

2524
protected readonly eventHandlers: ChatSocket.EventHandlers = {};
2625

2726
constructor({ socket }: ChatSocket.Args) {
2827
this.socket = socket;
29-
this.readyState = socket.readyState;
3028

3129
this.socket.addEventListener("open", this.handleOpen);
3230
this.socket.addEventListener("message", this.handleMessage);
3331
this.socket.addEventListener("close", this.handleClose);
3432
this.socket.addEventListener("error", this.handleError);
3533
}
3634

35+
/**
36+
* The current state of the connection; this is one of the Ready state constants
37+
*/
38+
get readyState(): number {
39+
return this.socket.readyState;
40+
}
41+
3742
/**
3843
* @param event - The event to attach to.
3944
* @param callback - The callback to run when the event is triggered.

0 commit comments

Comments
 (0)