useNotificationStore
The useNotificationStore hook provides direct access to the feed store state. This is a lower-level hook that subscribes to state changes from a feed client and returns the current state. It supports optional selectors for optimized re-renders.
Parameters
#A Feed client instance returned from useNotifications.
Optional selector function to extract a subset of the state. When provided, only re-renders when the selected value changes.
Returns
#Returns FeedStoreState (or T if a selector is provided) with the following properties:
Array of notification feed items.
Feed metadata including unread_count, unseen_count, and total_count.
Pagination information with before, after, and page_size.
Whether the feed is currently loading.
Current network request status.
Example
#Basic usage
#The following example demonstrates how to use the useNotificationStore hook to access feed state.
Using with a selector
#Use a selector to optimize re-renders by only subscribing to specific state changes:
Accessing multiple state properties
#You can select multiple properties at once: