Documentation
    Preparing search index...

    Function createNotificationService

    • Create a notification service handler.

      The notification service is a state registry that tracks notifications per napplet window. Napplets create and manage notifications via notifications:* topic events; the shell host controls presentation via the onChange callback.

      Parameters

      Returns ServiceHandler

      A ServiceHandler to register with the runtime

      import { createNotificationService } from '@kehto/services';

      const notifications = createNotificationService({
      onChange: (list) => {
      const unread = list.filter(n => !n.read);
      updateBadge(unread.length);
      },
      maxPerWindow: 50,
      });

      runtime.registerService('notifications', notifications);