feat(companion): add runtime dispose lifecycle helper

This commit is contained in:
William Valentin
2026-02-16 19:06:21 -08:00
parent d63704d436
commit fee32e8abe
4 changed files with 39 additions and 1 deletions
+5
View File
@@ -357,6 +357,11 @@ export class CompanionRuntimeClient {
ws.close(code, reason);
}
dispose(code?: number, reason?: string): void {
this.disconnect(code, reason);
this.clearEventSubscriptions();
}
subscribeEvents(handler: CompanionEventHandler): () => void {
this.eventHandlers.add(handler);
return () => {