(eventType: string)
| 44 | } |
| 45 | |
| 46 | function 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 | |
| 67 | function waveEventSubscribeSingle<T extends WaveEventName>(subscription: WaveEventSubscription<T>): () => void { |
| 68 | // console.log("waveEventSubscribeSingle", subscription); |
no test coverage detected