MCPcopy
hub / github.com/angular/angular / handlePush

Method handlePush

packages/service-worker/worker/src/driver.ts:410–424  ·  view source on GitHub ↗
(data: any)

Source from the content-addressed store, hash-verified

408 }
409
410 private async handlePush(data: any): Promise<void> {
411 await this.broadcast({
412 type: 'PUSH',
413 data,
414 });
415 if (!data.notification || !data.notification.title) {
416 return;
417 }
418 const desc = data.notification as {[key: string]: string | undefined};
419 let options: {[key: string]: string | undefined} = {};
420 NOTIFICATION_OPTION_NAMES.filter((name) => desc.hasOwnProperty(name)).forEach(
421 (name) => (options[name] = desc[name]),
422 );
423 await this.scope.registration.showNotification(desc['title']!, options);
424 }
425
426 private async handleClick(notification: Notification, action?: string): Promise<void> {
427 notification.close();

Callers 2

onPushMethod · 0.95

Calls 3

broadcastMethod · 0.95
forEachMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected