Skip to content

Commit

Permalink
feat(): include flag for parsed WS API responses
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagosiebler committed Jan 16, 2025
1 parent 3931c5e commit 56e945f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/util/BaseWSClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ interface WSClientEventMap<WsKey extends string> {
export interface EmittableEvent<TEvent = any> {
eventType: 'response' | 'update' | 'exception' | 'authenticated';
event: TEvent;
isWSAPIResponse?: boolean;
}

// Type safety for on and emit handlers: https://stackoverflow.com/a/61609010/880837
Expand Down
2 changes: 2 additions & 0 deletions src/websocket-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ export class WebsocketClient extends BaseWebsocketClient<WsKey> {
results.push({
eventType: 'exception',
event: parsed,
isWSAPIResponse: true,
});
return results;
}
Expand All @@ -743,6 +744,7 @@ export class WebsocketClient extends BaseWebsocketClient<WsKey> {
results.push({
eventType: 'response',
event: parsed,
isWSAPIResponse: true,
});

return results;
Expand Down

0 comments on commit 56e945f

Please sign in to comment.