Overview
Redux-powered hook that provides a paginated notification feed for the current authenticated user. Loads notifications and unread count on mount, supports infinite scrolling vialoadMore, and exposes mark-as-read actions with optimistic updates.
For integration guidance and template configuration, see App Notifications.
Usage Example
Parameters
Number of notifications to load per page: a whole number from
1 to 100. Defaults to 10. A larger value is rejected with 400 app-notification/invalid-query, never lowered to 100.Optional display text templates for each notification type. Applied at render time. See Notification Templates.
Returns
Array of notification records, augmented with
title and content if templates are provided.The last load failure, or
null. Cleared when the next load starts; loadMore() retries it. Shared by every mounted useAppNotifications: there is one notifications list. A SublayError.Load the next page of notifications and append it, or retry the load that failed (a failed first page is retried as the first page). Does nothing while a page is loading or when there is nothing more. Never rejects: a failure lands in
error.Marks a single notification as read with an optimistic local update. If the request fails, the notification goes back to unread, the unread count is restored, and the promise rejects.
Marks all notifications as read with an optimistic local update. If the request fails, the notifications that were unread go back to unread, the unread count is restored, and the promise rejects.
Reload page 1. The loaded notifications stay until the new first page replaces them. Useful for pull-to-refresh. Never rejects: a failure lands in
error.This hook requires the current user to be authenticated. It will not load until
user and projectId are available.
