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.
notifications:*
Optional
Optional configuration (onChange callback, maxPerWindow limit)
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); Copy
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);
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.