useNotifications
Function: useNotifications()
useNotifications<
T
>(mapper
,isSignedIn
,address
?,limit
?,refetchInterval
?,filters
?):object
Custom hook to manage notifications using the Haven1 SDK.
Type Parameters
• T
Parameters
mapper
(item
) => T
Function to map notification items.
isSignedIn
boolean
Indicates whether the user is signed in.
address?
string
Optional address associated with the notifications.
limit?
number
= 5
Optional limit for the number of notifications to fetch.
refetchInterval?
number
= ...
Optional interval in milliseconds for refetching notifications.
filters?
Record
<string
, string
[]> = {}
Optional filters applied to the notifications.
Returns
object
newNotifications
newNotifications:
object
[]
newNotificationsCount
newNotificationsCount:
undefined
|string
notifications
notifications:
UseInfiniteQueryResult
<InfiniteData
<{hasMore
:boolean
;items
:never
[];pageParam
:number
;rawItems
:undefined
; } | {hasMore
:boolean
;items
:T
[];pageParam
:number
;rawItems
:object
[]; },unknown
>,Error
>
resetUnviewedNotifications()
resetUnviewedNotifications: () =>
void
Returns
void
Defined in
Last updated