MCPcopy
hub / github.com/angular/angular / handleClose

Method handleClose

packages/service-worker/worker/src/driver.ts:490–500  ·  view source on GitHub ↗

* Handles the closing of a notification by extracting its options and * broadcasting a `NOTIFICATION_CLOSE` message. * * This is typically called when a notification is dismissed by the user * or closed programmatically, and it relays that information to clients * listening for servic

(notification: Notification, action: string)

Source from the content-addressed store, hash-verified

488 * @param action - The action string associated with the close event, if any (usually an empty string).
489 */
490 private async handleClose(notification: Notification, action: string): Promise<void> {
491 const options: {-readonly [K in keyof Notification]?: Notification[K]} = {};
492 NOTIFICATION_OPTION_NAMES.filter((name) => name in notification).forEach(
493 (name) => (options[name] = notification[name]),
494 );
495
496 await this.broadcast({
497 type: 'NOTIFICATION_CLOSE',
498 data: {action, notification: options},
499 });
500 }
501
502 /**
503 * Handles changes to the push subscription by capturing the old and new

Callers 1

onCloseMethod · 0.95

Calls 3

broadcastMethod · 0.95
forEachMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected