MCPcopy Create free account
hub / github.com/astercloud/aster / subscribeToDelete

Method subscribeToDelete

ui/src/protocol/message-processor.ts:519–531  ·  view source on GitHub ↗

* Subscribe to surface deletion events * @param surfaceId - The surface ID to watch for deletion * @param listener - Callback when surface is deleted * @returns Unsubscribe function

(surfaceId: string, listener: (surfaceId: string) => void)

Source from the content-addressed store, hash-verified

517 * @returns Unsubscribe function
518 */
519 subscribeToDelete(surfaceId: string, listener: (surfaceId: string) => void): () => void {
520 let listeners = this.deleteListeners.get(surfaceId);
521 if (!listeners) {
522 listeners = new Set();
523 this.deleteListeners.set(surfaceId, listeners);
524 }
525 listeners.add(listener);
526
527 // Return unsubscribe function
528 return () => {
529 listeners?.delete(listener);
530 };
531 }
532
533 /**
534 * Notify delete listeners of surface deletion

Callers 1

Calls 3

getMethod · 0.45
setMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected