MCPcopy
hub / github.com/wavetermdev/waveterm / updateWaveEventSub

Function updateWaveEventSub

frontend/app/store/wps.ts:46–65  ·  view source on GitHub ↗
(eventType: string)

Source from the content-addressed store, hash-verified

44}
45
46function updateWaveEventSub(eventType: string) {
47 if (isPreviewWindow()) {
48 return;
49 }
50 const subjects = waveEventSubjects.get(eventType);
51 if (subjects == null) {
52 RpcApi.EventUnsubCommand(WpsRpcClient, eventType, { noresponse: true });
53 return;
54 }
55 const subreq: SubscriptionRequest = { event: eventType, scopes: [], allscopes: false };
56 for (const scont of subjects) {
57 if (isBlank(scont.scope)) {
58 subreq.allscopes = true;
59 subreq.scopes = [];
60 break;
61 }
62 subreq.scopes.push(scont.scope);
63 }
64 RpcApi.EventSubCommand(WpsRpcClient, subreq, { noresponse: true });
65}
66
67function waveEventSubscribeSingle<T extends WaveEventName>(subscription: WaveEventSubscription<T>): () => void {
68 // console.log("waveEventSubscribeSingle", subscription);

Callers 3

wpsReconnectHandlerFunction · 0.85
waveEventSubscribeSingleFunction · 0.85
waveEventUnsubscribeFunction · 0.85

Calls 6

isPreviewWindowFunction · 0.90
isBlankFunction · 0.90
getMethod · 0.80
pushMethod · 0.80
EventUnsubCommandMethod · 0.65
EventSubCommandMethod · 0.65

Tested by

no test coverage detected